From cb5f3037bb18403433c2cfd0271f6bea76906aca Mon Sep 17 00:00:00 2001 From: Horus_Arch Date: Wed, 18 Feb 2015 17:03:41 +0100 Subject: Reimplementation with gorilla toolkit. --- main.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 main.go (limited to 'main.go') diff --git a/main.go b/main.go new file mode 100644 index 0000000..fcbeaf5 --- /dev/null +++ b/main.go @@ -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) +} -- cgit v1.2.3