express-render-template
This package in no longer supported and has been replaced by node-iframe-replacement
Use the HTML source of an external URL as an express layout template, a clean alternative to an iframe.
Extends res.render allowing an external URL to be used as a layout & CSS selector as a placeholder location to inject view content.
Installation
$ npm install --save express-render-template
Usage
The example below will request the Mammoth Workwear home page and replace the contents of #promo-banner with the contents of the view
var renderTemplate = ; // replace res.render with renderTemplate versionapp; // create a regular express routeapp;
View template
20% off Dickies Workwear
Auto base tag injection
To ensure scripts, styles and images in the external template load on your site, the render method injects a HTML base tag <base href="http://mammothworkwear.com" />
. Therefore you need to ensure any links within your view are absolute.
License
ISC License © 2016 John Doherty