mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
parent
591e0ad995
commit
ed80286431
@ -16,17 +16,14 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
host = flag.String("host", "", "host name")
|
httpAddr = flag.String("http", ":8000", "HTTP address")
|
||||||
port = flag.Int("port", 8000, "port number")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -42,10 +39,5 @@ func init() {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
http.Handle("/", http.FileServer(http.Dir(rootPath)))
|
http.Handle("/", http.FileServer(http.Dir(rootPath)))
|
||||||
if *host == "" {
|
log.Fatal(http.ListenAndServe(*httpAddr, nil))
|
||||||
fmt.Printf("http://127.0.0.1:%d/\n", *port)
|
|
||||||
} else {
|
|
||||||
fmt.Printf("http://%s:%d/\n", *host, *port)
|
|
||||||
}
|
|
||||||
log.Fatal(http.ListenAndServe(*host+":"+strconv.Itoa(*port), nil))
|
|
||||||
}
|
}
|
||||||
|
@ -28,13 +28,11 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
host = flag.String("host", "", "host name")
|
httpAddr = flag.String("http", ":8000", "HTTP address")
|
||||||
port = flag.Int("port", 8000, "port number")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -168,10 +166,5 @@ func main() {
|
|||||||
http.HandleFunc("/main.js", serveMainJS)
|
http.HandleFunc("/main.js", serveMainJS)
|
||||||
http.HandleFunc("/main.js.map", serveMainJSMap)
|
http.HandleFunc("/main.js.map", serveMainJSMap)
|
||||||
http.HandleFunc("/", serveFileHandle)
|
http.HandleFunc("/", serveFileHandle)
|
||||||
if *host == "" {
|
log.Fatal(http.ListenAndServe(*httpAddr, nil))
|
||||||
fmt.Printf("http://127.0.0.1:%d/\n", *port)
|
|
||||||
} else {
|
|
||||||
fmt.Printf("http://%s:%d/\n", *host, *port)
|
|
||||||
}
|
|
||||||
log.Fatal(http.ListenAndServe(*host+":"+strconv.Itoa(*port), nil))
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user