Create public static files to serve
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user