From 02e6a8b9ae3596ee1c405cdd1541c5cc59b50e3a Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 19 Feb 2015 13:30:54 +0100 Subject: Static file handling and autoimport the db-driver from Makefile. --- app/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/main.go') diff --git a/app/main.go b/app/main.go index 0a8b7dd..ac2f27b 100644 --- a/app/main.go +++ b/app/main.go @@ -9,14 +9,16 @@ import ( var decoder = schema.NewDecoder() -//var mainTempl = template.Must(template.New("global").ParseFiles("templates/header.html", "templates/navbar.html", "templates/footer.html")) -var mainTempl = template.Must(template.New("global").ParseGlob("../templates/*.html")) +var mainTempl = template.Must(template.New("global").ParseGlob("../views/*.html")) func main() { + run() InitDB() r := mux.NewRouter() r.HandleFunc("/", IndexHandler) + //r.HandleFunc("/static", StaticHandler) + r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./../static")))) r.HandleFunc("/register", RegisterHandler).Methods("POST") r.HandleFunc("/register", PrintRegisterHandler).Methods("GET") r.HandleFunc("/new", AddNewJobHandler).Methods("POST") -- cgit v1.2.3