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