This commit is contained in:
parent
53bb6bdf23
commit
f1695c3136
9
main.go
9
main.go
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"gitlab.com/golang-commonmark/markdown"
|
||||
"html/template"
|
||||
|
@ -409,6 +410,10 @@ func (h *recentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func main() {
|
||||
var port int
|
||||
flag.IntVar(&port, "port", 8080, "http port")
|
||||
flag.Parse()
|
||||
|
||||
mp = NewFilePages("data")
|
||||
|
||||
http.Handle("/auth/", &authHandler{})
|
||||
|
@ -419,6 +424,6 @@ func main() {
|
|||
http.Handle("/recent/", &recentHandler{})
|
||||
http.Handle("/", &indexHandler{})
|
||||
|
||||
fmt.Printf("Running on port 8080")
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
fmt.Printf("Running on port %d\n", port)
|
||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), nil))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user