Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Koa = function () {
var version = parseInt(require('koa/package.json').version.split('.')[0])
var app = new _Koa()
if (version >= 2) {
var _use = app.use
app.use = (mw) => _use.call(app, convert(mw))
}
return app
}
Koa = function () {
var version = parseInt(require('koa/package.json').version.split('.')[0])
var app = new _Koa()
if (version >= 2) {
var _use = app.use
app.use = (mw) => _use.call(app, convert(mw))
}
return app
}
var hapi = parseInt(require('hapi/package.json').version.split('.')[0])
Koa = function () {
var version = parseInt(require('koa/package.json').version.split('.')[0])
var app = new _Koa()
if (version >= 2) {
var _use = app.use
app.use = (mw) => _use.call(app, convert(mw))
}
return app
}
Koa = function () {
var version = parseInt(require('koa/package.json').version.split('.')[0])
var app = new _Koa()
if (version >= 2) {
var _use = app.use
app.use = (mw) => _use.call(app, convert(mw))
}
return app
}
: fs.readFileSync(resolve('dist/template.html'), 'utf-8')
const app = new Koa()
app
.use(compress())
.use(logger())
.use(serve(resolve('public')))
router(app)
let renderer
let readyPromise
let mfs
const koaVersion = require('koa/package.json').version
const vueVersion = require('vue-server-renderer/package.json').version
const INDEX_PAGE = '__non-ssr-page__.html'
const DEFAULT_HEADERS = {
'Content-Type': 'text/html',
Server: `koa/${koaVersion}; vue-server-renderer/${vueVersion}`,
}
const NON_SSR_PATTERN = ['/test']
const STATIC_PATTERN = ['/', '/articles', '/article/:id(\\d+)']
app.use(async (ctx, next) => {
await readyPromise
if (