コード例 #1
0
ファイル: middleware.go プロジェクト: cautonwong/mailslurper
func setupMiddleware(httpListener *listener.HTTPListenerService, appContext *middleware.AppContext) {
	httpListener.
		AddMiddleware(appContext.Logger).
		AddMiddleware(appContext.StartAppContext).
		AddMiddleware(appContext.AccessControl).
		AddMiddleware(appContext.OptionsHandler)
}
コード例 #2
0
ファイル: routes.go プロジェクト: cautonwong/mailslurper
/*
Add routes here using AddRoute and AddRouteWithMiddleware.
*/
func setupRoutes(httpListener *listener.HTTPListenerService, appContext *middleware.AppContext) {
	httpListener.
		AddStaticRoute("/assets/", "./www/assets").
		AddRoute("/", controllers.Index, "GET").
		AddRoute("/admin", controllers.Admin, "GET").
		AddRoute("/savedsearches", controllers.ManageSavedSearches, "GET").
		AddRoute("/servicesettings", controllers.GetServiceSettings, "GET", "OPTIONS").
		AddRoute("/version", controllers.GetVersion, "GET", "OPTIONS")
}