2018-03-24 02:17:22 +00:00
|
|
|
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)
|
2018-03-24 02:24:54 +00:00
|
|
|
log.Fatal(http.ListenAndServe(":"+p, http.FileServer(sfs)))
|
2018-03-24 02:17:22 +00:00
|
|
|
}
|