You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
430 B
Go
19 lines
430 B
Go
1 year ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
mux := http.NewServeMux()
|
||
|
fileServer := http.FileServer(http.Dir("./ui/static/"))
|
||
|
mux.Handle("/static/", http.StripPrefix("/static", fileServer))
|
||
|
mux.HandleFunc("/", home)
|
||
|
mux.HandleFunc("/snippet/view", snippetView)
|
||
|
mux.HandleFunc("/snippet/create", snippetCreate)
|
||
|
log.Print("Starting server on :4000")
|
||
|
err := http.ListenAndServe(":4000", mux)
|
||
|
log.Fatal(err)
|
||
|
}
|