prerender: remove meta tag after prerendering;
This commit is contained in:
1 parent
13d909c219
commit
da79a17374
1 file changed
+9
@@ -20,6 +20,15 @@ app.use(bodyParser());
|
|||||||
app.use(logger());
|
app.use(logger());
|
||||||
app.use(conditional());
|
app.use(conditional());
|
||||||
app.use(etag());
|
app.use(etag());
|
||||||
|
|
||||||
|
app.use(function *(next) {
|
||||||
|
yield* next;
|
||||||
|
|
||||||
|
try{
|
||||||
|
var xp = this.response.header['x-prerender'] == 'true';
|
||||||
|
if(xp) this.body = this.body.replace('<meta name="fragment" content="!">', '');
|
||||||
|
}catch(e){}
|
||||||
|
});
|
||||||
app.use(prerender(config.prerender));
|
app.use(prerender(config.prerender));
|
||||||
|
|
||||||
app.use(serve(path.join(__dirname, "public")));
|
app.use(serve(path.join(__dirname, "public")));
|
||||||
|
|||||||
Reference in new issue
Block a user