ch2.9
This commit is contained in:
@@ -7,9 +7,12 @@ import (
|
||||
|
||||
func main() {
|
||||
mux := http.NewServeMux()
|
||||
fileServer := http.FileServer(http.Dir("./ui/static/"))
|
||||
|
||||
mux.HandleFunc("/", home)
|
||||
mux.HandleFunc("/snippet/view", snippetView)
|
||||
mux.HandleFunc("/snippet/create", snippetCreate)
|
||||
mux.Handle("/static/", http.StripPrefix("/static", fileServer))
|
||||
|
||||
log.Print("Starting server on :4000")
|
||||
err := http.ListenAndServe(":4000", mux)
|
||||
|
||||
Reference in New Issue
Block a user