prerender-http-headers

1.0.2 • Public • Published

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'

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i prerender-http-headers

    Weekly Downloads

    4

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    4.43 kB

    Total Files

    10

    Last publish

    Collaborators

    • xdimedrolx