summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/main.go b/main.go
index b18bd8d..b810e12 100644
--- a/main.go
+++ b/main.go
@@ -4,7 +4,6 @@ import (
"github.com/gorilla/mux"
"github.com/gorilla/schema"
"github.com/gorilla/sessions"
- "github.com/robfig/cron"
"html/template"
"log"
"net/http"
@@ -13,14 +12,11 @@ import (
var decoder = schema.NewDecoder()
-//var store = sessions.NewCookieStore([]byte(RandomKey()))
var store = sessions.NewCookieStore([]byte(os.Getenv("FREEMAIL_SECRET")))
var mainTempl = template.Must(template.New("global").Funcs(template.FuncMap{"add": add}).ParseGlob("./views/*.html"))
var emailTempl = template.Must(template.New("email").Funcs(template.FuncMap{"add": add}).ParseGlob("./views/email/*.html"))
-var c = cron.New()
-
func add(x, y int) int {
return x + y
}
@@ -36,8 +32,9 @@ func main() {
InitDB()
r := mux.NewRouter()
- // r.HandleFunc("/", IndexHandler)
- r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./../static"))))
+ r.HandleFunc("/", IndexHandler)
+ r.HandleFunc("/create", CreateNewEntryHandler).Methods("POST")
+ r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static"))))
http.Handle("/", r)