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