InitMiddleware sets up the necessary middlewares for the microservice. These include middlewares to establish a sane context containing access to the configuration, worker queue, statsd client, and Sentry client (Raven). The latter two are disabled in debugging mode to avoid contaminating production stats. It will also set up a middleware for catching, and handling errors thrown from a route.
// Get config vars from the environment conf := NewEnvConfig() InitMiddleware(router, conf) InitSecureRoutes(router, conf) InitSimpleRoutes(router, conf)