mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
refactor: export
This commit is contained in:
@@ -8,6 +8,7 @@ import fs from 'fs'
|
||||
import _ from 'lodash-es'
|
||||
import './install.js'
|
||||
import pathUtil from './utils/util.path.js'
|
||||
import compress from 'koa-compress'
|
||||
const app = new Koa()
|
||||
|
||||
// error handler
|
||||
@@ -21,10 +22,14 @@ app.use(json())
|
||||
app.use(logger())
|
||||
|
||||
const staticPlugin = Static(pathUtil.join('public'), {
|
||||
maxage: 30 * 24 * 60 * 3600
|
||||
maxage: 30 * 24 * 60 * 3600,
|
||||
gzip: true
|
||||
})
|
||||
app.use(staticPlugin)
|
||||
|
||||
// gzip
|
||||
app.use(compress({ threshold: 2048 }))
|
||||
|
||||
// logger
|
||||
app.use(async (ctx, next) => {
|
||||
const start = new Date()
|
||||
|
||||
Reference in New Issue
Block a user