prerender-http-headers
v1.0.2
Published
Prerender plugin that adds `httpHeaders` option for headers and forwards them to puppeteer
Downloads
5
Readme
prerender-http-headers
Prerender (https://github.com/prerender/prerender) plugin that adds httpHeaders
option for a set of headers and forwards them to puppeteer.
Usage
In your prerender project run:
$ npm install prerender-http-headers --save
Then in the server.js that initializes the prerender:
server.use(require('prerender-http-headers'));
Example of requests
GET:
$ curl http://localhost:3000/render?url=https://www.example.com/&httpHeaders[x-token]=1111&httpHeaders[user]=test
POST:
$ curl -XPOST -d '{
"url": "https://www.example.com/",
"httpHeaders": {
"x-token": "1111",
"user": "test"
}
}' 'http://localhost:3000/render'