summaryrefslogtreecommitdiff
path: root/app/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.go')
-rw-r--r--app/main.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/main.go b/app/main.go
new file mode 100644
index 0000000..0a8b7dd
--- /dev/null
+++ b/app/main.go
@@ -0,0 +1,26 @@
+package main
+
+import (
+ "github.com/gorilla/mux"
+ "github.com/gorilla/schema"
+ "html/template"
+ "net/http"
+)
+
+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"))
+
+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)
+}