Ejemplo n.º 1
0
func setupMiddleware(httpListener *listener.HTTPListenerService, appContext *middleware.AppContext) {
	httpListener.
		AddMiddleware(appContext.Logger).
		AddMiddleware(appContext.StartAppContext).
		AddMiddleware(appContext.AccessControl).
		AddMiddleware(appContext.OptionsHandler)
}
Ejemplo n.º 2
0
/*
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")
}