diff options
| author | Horus_Arch | 2015-02-18 17:03:41 +0100 |
|---|---|---|
| committer | Horus_Arch | 2015-02-18 17:03:41 +0100 |
| commit | cb5f3037bb18403433c2cfd0271f6bea76906aca (patch) | |
| tree | 448397529fdbd1660b12001918289e04aa1c7ea6 /main.go | |
| parent | d6ab45e8ec5f26004b4efc07383245051d546bf3 (diff) | |
| download | statuspage-cb5f3037bb18403433c2cfd0271f6bea76906aca.tar.gz | |
Reimplementation with gorilla toolkit.
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +package main + +import ( + "github.com/gorilla/mux" + "github.com/gorilla/schema" + //"html/template" + "net/http" +) + +var decoder = schema.NewDecoder() + +//var templ = template.Must(template.ParseFiles("templates/header.html", "templates/navbar.html", "templates/footer.html")) + +func main() { + InitDB() + + r := mux.NewRouter() + r.HandleFunc("/", IndexHandler) + r.HandleFunc("/register", RegisterHandler).Methods("POST") + r.HandleFunc("/register", PrintRegisterHandler).Methods("GET") + r.HandleFunc("/new", AddNewJobHandler).Methods("POST") + r.HandleFunc("/new", PrintNewJobHandler).Methods("GET") + http.Handle("/", r) + http.ListenAndServe(":8080", nil) +} |
