Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network templates #200

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

andy9775
Copy link

@andy9775 andy9775 commented Dec 9, 2016

I added the ability to fetch handlebars templates from a remote resource. This is useful if using webpack dev server with HtmlWebPackPlugin to generate our handlebars templates. This can also be used in production if you have network based templates.

This PR is backwards compatible with existing configuration and does not break anything.

A View resolver must be used with express when loading routes from a
networked resource which ensures that express doesn't handle the
template path its self.

example:
var NetworkView = require('express-handlebars').NetowrkView;
// or: import {NetworkView} from 'express-handlebars';

app.set('view', NetworkView);
app.engine('handlebars', {/* config */});
By defining a specified config object, express-handlebars can now fetch
templates and partials from a remote resource and is not limited to
locally provided handlebars files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant