Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Koa = require('koa')
- const { errorHandler, errorLogger } = require('./errors')
- const logHandler = require('./logger')
- const configHandler = require('./config')
- module.exports = (routes) => {
- const app = new Koa()
- app.use(errorHandler)
- app.use(logHandler)
- app.use(configHandler)
- app.use(routes)
- app.on('error', errorLogger)
- return app
- }
Add Comment
Please, Sign In to add comment