コード例 #1
0
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 プロジェクト: adampresley/minitextindexer
/*
Add routes here using AddRoute and AddRouteWithMiddleware.
*/
func setupRoutes(httpListener *listener.HTTPListenerService, appContext *middleware.AppContext) {
	httpListener.
		AddRoute("/getterm", controllers.GetSpecificTerm, "GET", "OPTIONS").
		AddRoute("/search", controllers.Search, "GET", "OPTIONS").
		AddRoute("/version", controllers.GetVersion, "GET")
}