Simplen ServeMux erstellt
This commit is contained in:
parent
d6540d5764
commit
16240b8c01
15
main.go
15
main.go
@ -1,3 +1,16 @@
|
||||
package main
|
||||
|
||||
func main() {}
|
||||
import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
template.Must(template.ParseFiles("templates/index.html")).Execute(w, nil)
|
||||
})
|
||||
|
||||
log.Fatalln(http.ListenAndServe(":8080", mux))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user