4 Star 25 Fork 5

Featwork/FeatBlog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app.js 582 Bytes
一键复制 编辑 原始数据 按行查看 历史
Featwork 提交于 2021-01-23 13:49 +08:00 . app
const Koa = require('koa')
const views = require('koa-views')
const compress = require('koa-compress')
const app = new Koa()
const index = require('./app/index.js')
app.use(async (ctx, next) => {
ctx.state.url = process.env.URL
await next()
})
app.use(compress({
filter (content_type) {
return /text/i.test(content_type)
},
threshold: 1024,
flush: require('zlib').Z_SYNC_FLUSH,
}))
app.use(require('koa-static')(__dirname + '/public'))
app.use(views(__dirname + '/views', {
map: {html: 'ejs'}
}))
app.use(index.routes(), index.allowedMethods())
module.exports = app
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/featwork/featblog.git
[email protected]:featwork/featblog.git
featwork
featblog
FeatBlog
master

搜索帮助