mtfosbot/app.js

16 lines
377 B
JavaScript
Raw Normal View History

2018-06-25 10:07:10 +00:00
const config = require('./config')
const Koa = require('koa')
const koaLogger = require('koa-logger')
const router = require('./route')
const app = new Koa()
app.use(koaLogger())
app.use(router.allowedMethods())
app.use(router.routes())
const server = app.listen(config.port, () => {
console.log(`server start on port ${server.address().port}`)
})
module.exports = server