func main() { file, err := os.Open("config.json") if err != nil { panic(err) } app := golf.New() app.Get("/version", versionHandler) app.Get("/", homeHandler) app.Config, err = golf.ConfigFromJSON(file) app.Run(":9000") }
func main() { app := golf.New() app.Use(golf.XSRFProtectionMiddleware) app.View.SetTemplateLoader("default", ".") app.Get("/", mainHandler) app.Post("/login", loginHandlerPost) app.Get("/login", loginHandler) app.Run(":9000") }
func main() { app := golf.New() app.View.SetTemplateLoader("default", ".") app.SessionManager = golf.NewMemorySessionManager() app.Use(golf.SessionMiddleware) app.Get("/", mainHandler) app.Post("/login", loginHandlerPost) app.Get("/login", loginHandler) app.Run(":9000") }