Skip to content

xdimedrolx/prerender-http-headers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published