Server is now fully configurable with cli flags
This commit is contained in:
parent
13ad58614a
commit
4daca8fd5e
3
main.go
3
main.go
@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
dir = kingpin.Flag("directory", "Path to dir which has to be served.").Required().Short('d').String()
|
dir = kingpin.Flag("directory", "Path to dir which has to be served.").Required().Short('d').String()
|
||||||
|
port = kingpin.Flag("port", "Port to run at").Default("8080").String()
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -13,7 +14,7 @@ func main() {
|
|||||||
kingpin.Parse()
|
kingpin.Parse()
|
||||||
|
|
||||||
s := Server{
|
s := Server{
|
||||||
port: ":8080",
|
port: ":" + *port,
|
||||||
dirPath: *dir,
|
dirPath: *dir,
|
||||||
}
|
}
|
||||||
s.Serve()
|
s.Serve()
|
||||||
|
Loading…
Reference in New Issue
Block a user