mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 09:39:08 +00:00
Merge pull request #2952 from kojustin/serve
Subcommand serve should parse flags.
This commit is contained in:
commit
a6428c7dee
@ -28,6 +28,7 @@ func serve(args []string) {
|
||||
}
|
||||
portFlag := flags.String("port", ":8080", "Local port to serve on")
|
||||
dirFlag := flags.String("directory", ".", "Directory to serve")
|
||||
flags.Parse(args)
|
||||
|
||||
http.Handle("/", http.FileServer(http.Dir(*dirFlag)))
|
||||
log.Fatal(http.ListenAndServe(*portFlag, logRequest(http.DefaultServeMux)))
|
||||
|
Loading…
Reference in New Issue
Block a user