mtfosbot/app.js
2018-06-25 18:07:10 +08:00

16 lines
377 B
JavaScript

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