summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorHorus_Arch2015-02-18 17:03:41 +0100
committerHorus_Arch2015-02-18 17:03:41 +0100
commitcb5f3037bb18403433c2cfd0271f6bea76906aca (patch)
tree448397529fdbd1660b12001918289e04aa1c7ea6 /main.go
parentd6ab45e8ec5f26004b4efc07383245051d546bf3 (diff)
downloadstatuspage-cb5f3037bb18403433c2cfd0271f6bea76906aca.tar.gz
Reimplementation with gorilla toolkit.
Diffstat (limited to 'main.go')
-rw-r--r--main.go25
1 files changed, 25 insertions, 0 deletions
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)
+}