No Prerender.io
This commit is contained in:
1 parent
acf1eee521
commit
c2a457eea7
2 files changed
-16
No files matched your search
@@ -6,7 +6,6 @@ import logger from 'koa-logger'
|
||||
import convert from 'koa-convert'
|
||||
import conditional from 'koa-conditional-get'
|
||||
import etag from 'koa-etag'
|
||||
import prerender from 'koa-prerender'
|
||||
import helmet from 'koa-helmet'
|
||||
import mount from 'koa-mount'
|
||||
import cookie from 'koa-cookie'
|
||||
@@ -45,8 +44,6 @@ export default function (store) {
|
||||
app.use(cookie())
|
||||
app.use($(conditional()))
|
||||
app.use($(etag()))
|
||||
app.use(prerenderRmFragment())
|
||||
app.use($(prerender(config.prerender)))
|
||||
app.use(serve(dirPublic))
|
||||
app.use(serve(dirTemplates))
|
||||
app.use($(redirect(redirectionTable)))
|
||||
@@ -66,15 +63,3 @@ function apis(store) {
|
||||
let checkAuth = authChecker(serviceKeys)
|
||||
return mount('/api/v1', apiV1(checkAuth, store))
|
||||
}
|
||||
|
||||
function prerenderRmFragment() {
|
||||
return async(ctx, next) => {
|
||||
await next()
|
||||
|
||||
try {
|
||||
let xp = ctx.response.header['x-prerender'] === 'true'
|
||||
if (xp) ctx.body = ctx.body.replace('<meta name="fragment" content="!">', '')
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user