代码拉取完成,页面将自动刷新
'use strict'
const lodash = require('lodash')
const serve = require('koa-static')
const views = require('koa-views')
const session = require('koa-session')
const bodyParser = require('koa-bodyparser')
const router = require('./lib/router.js')
const configDefault = require('./lib/config.default.js')
const model = require('./lib/model.js')
const display = require('./lib/display.js')
const rawBody = require('./lib/rawBody.js')
module.exports = (app, config, base_dir) => {
app.config = lodash.assign(configDefault(base_dir || process.cwd()), config)
app.keys = app.config.appkeys
app.use(serve(app.config.public_path))
app.use(bodyParser())
app.use(rawBody())
app.use(session(app.config.session_setting, app))
app.use(views(app.config.view_path, app.config.view_opts))
app.use(model(app.config.model_path, app.config.mysql))
app.use(display)
app.use(router(app.config.router_map, app.config.controller_path))
return app
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。