diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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) |
