1.0.2 • Published 2 years ago

prerender-http-headers v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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'
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago