Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "html/template"
- "log"
- "net/http"
- )
- var tpl *template.Template
- func init() {
- tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
- }
- func main() {
- // CSS
- http.Handle("/static/css", http.StripPrefix("/static/css/", http.FileServer(http.Dir("static/css/style.css"))))
- // JS
- http.Handle("/static/js", http.StripPrefix("/static/js/", http.FileServer(http.Dir("static/js/script.js"))))
- // Sem favicon.ico - Retorna 404
- http.Handle("/favicon.ico", http.NotFoundHandler())
- http.HandleFunc("/", index)
- log.Fatalln(http.ListenAndServe(":8080", nil))
- }
- func index(w http.ResponseWriter, r *http.Request) {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement