Create public static files to serve

This commit is contained in:
bel
2020-04-12 17:28:05 +00:00
parent 1a3ba7c5e9
commit a255d391b5
3 changed files with 21 additions and 1 deletions

View File

@@ -6,7 +6,8 @@ import (
)
var (
Port string
Port string
Public string
)
func init() {
@@ -16,8 +17,10 @@ func init() {
func New() {
as := args.NewArgSet()
as.Append(args.INT, "p", "port to listen on", 52222)
as.Append(args.STRING, "d", "dir with public files", "./public")
if err := as.Parse(); err != nil {
panic(err)
}
Port = fmt.Sprintf(":%d", as.GetInt("p"))
Public = as.GetString("d")
}