Vendor and appengine

This commit is contained in:
Bel LaPointe
2018-09-30 16:22:52 -06:00
parent 3ec6314cca
commit 3e2e8f1275
65 changed files with 24147 additions and 11 deletions

17
main.go
View File

@@ -1,11 +1,3 @@
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
import (
@@ -15,6 +7,8 @@ import (
"os"
"path"
"path/filepath"
"google.golang.org/appengine"
)
func main() {
@@ -22,13 +16,14 @@ func main() {
if err != nil {
panic(err)
}
exePath = "."
port := flag.String("p", "8100", "port to serve on")
directory := flag.String("d", path.Join(exePath, "public"), "the directory of static file to host")
flag.Parse()
http.Handle("/", http.FileServer(http.Dir(*directory)))
log.Printf("Serving %s on HTTP port: %s\n", *directory, *port)
log.Fatal(http.ListenAndServe(":"+*port, nil))
log.Printf("Serving %s\n", *directory)
appengine.Main()
}