diff options
| author | Horus3 | 2015-02-19 13:30:54 +0100 |
|---|---|---|
| committer | Horus3 | 2015-02-19 13:30:54 +0100 |
| commit | 02e6a8b9ae3596ee1c405cdd1541c5cc59b50e3a (patch) | |
| tree | 157a800cc381e78bb03b8868417db8fe12ca8239 /app/main.go | |
| parent | d9749f16e15739c7652b05af391af9e59e2307d6 (diff) | |
| download | statuspage-02e6a8b9ae3596ee1c405cdd1541c5cc59b50e3a.tar.gz | |
Static file handling and autoimport the db-driver from Makefile.
Diffstat (limited to 'app/main.go')
| -rw-r--r-- | app/main.go | 6 |
1 files changed, 4 insertions, 2 deletions
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") |
