summaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorHorus32015-02-19 02:38:34 +0100
committerHorus32015-02-19 02:38:34 +0100
commitf53fa2f2f9eb445527e0a1b29b9e37c224499233 (patch)
tree229cc07cb4713a01393d4775f98ec733baa2afe7 /handler.go
parent58e63343703e0c3f3c12934e62fc0f4575761869 (diff)
downloadstatuspage-f53fa2f2f9eb445527e0a1b29b9e37c224499233.tar.gz
Reorder files and parses templates.
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go63
1 files changed, 0 insertions, 63 deletions
diff --git a/handler.go b/handler.go
deleted file mode 100644
index 16640ae..0000000
--- a/handler.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package main
-
-import (
- "fmt"
- "html/template"
- "log"
- "net/http"
-)
-
-func IndexHandler(w http.ResponseWriter, r *http.Request) {
- fmt.Fprintf(w, "Hello World! \n")
- // w.Write()
-}
-
-func RegisterHandler(w http.ResponseWriter, r *http.Request) {
- log.Println("Processing registration!")
- fmt.Fprintf(w, "Processing registration! \n")
- // w.Write()
-}
-
-func PrintRegisterHandler(w http.ResponseWriter, r *http.Request) {
-
- fmt.Fprintf(w, "Printing register etc! \n")
- // w.Write()
-}
-
-func PrintNewJobHandler(w http.ResponseWriter, r *http.Request) {
- log.Printf("Printing job")
- //t := template.Must(template.ParseFiles("templates/header.html", "templates/navbar.html", "templates/jobs.html", "templates/footer.html"))
- t := template.Must(template.ParseFiles("templates/jobs.html", "templates/header.html", "templates/navbar.html", "templates/footer.html"))
- //t := template.New("job")
- //t := templ
- //fmt.Printf("%s", t)
- //t, err := template.ParseFiles("templates/jobs.html", "templates/header.html")
- //t, err := template.ParseFiles("templates/jobs.html")
- //t, err := t.ParseFiles("templates/jobs.html")
- //if err != nil {
- // log.Panic(err)
- //}
- err := t.Execute(w, nil)
- if err != nil {
- log.Panic(err)
- }
-}
-
-func AddNewJobHandler(w http.ResponseWriter, r *http.Request) {
- log.Printf("Add new job")
-
- err := r.ParseForm()
- if err != nil {
- log.Panic(err)
- }
-
- host := &Host{}
- err = decoder.Decode(host, r.PostForm)
- if err != nil {
- log.Panic(err)
- }
-
- log.Printf("%v", host)
- fmt.Fprintf(w, "%s", host.Url)
- Db.Debug().Save(host)
-}