Skip to content

ravenlp/prerender-header-forwarder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#prerender-header-forwarder

Prerender (https://github.com/prerender/prerender) plugin that enables you to specify a set of headers to be forwarded to phantomJs when present on the original request.

##How to use

In your local prerender project run:

$ npm install prerender-header-forwarder --save

Then in the server.js that initializes the prerender:

// Specifying the headers in the in code
server.use(require('prerender-header-forwarder')(['X-Override-Service', 'X-Example-Header']));

##Using External Configuration You can use the environment variable FORWARD_HEADER

export FORWARD_HEADER=X-Override-Service,X-Example-Header
node server.js
# Or whatever you use to run your prerender server

The on the server.js

server.use(require('prerender-header-forwarder')());
// Don't forget to include the '()'

About

Prerender plugin to enable forwarding selected headers to phantomJs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published