tulpaforce/cmd/sserver/main.go

26 lines
438 B
Go

package main // import "git.xeserv.us/xena/tulpaforce.tk/cmd/sserver"
import (
"log"
"net/http"
"os"
"github.com/rakyll/statik/fs"
_ "git.xeserv.us/xena/tulpaforce.tk/cmd/sserver/statik"
)
func main() {
p := os.Getenv("PORT")
if p == "" {
p = "80"
}
sfs, err := fs.New()
if err != nil {
log.Fatal(err)
}
log.Printf("Listening on http://127.0.0.1:%s", p)
log.Fatal(http.ListenAndServe(":"+p, http.FileServer(sfs)))
}