serve-angular
v0.2.1
Published
Serve the AngularJS layout only when the request doesn't look like a file
Downloads
3
Maintainers
Readme
serve-angular
Serve the AngularJS layout only when the request doesn't look like a file
Prevent the infinite loop that crash your browser when a template file is not found in your layout
Install
$ npm install serve-angular
API
var serveAngular = require('serve-angular');
serveAngular(options)
Serve the Angular layout unless the ignoreRegex is true. Also add all your AngularJS scripts automatically.
Options available:
layout (required)File path of your Angular layout
ignoreRegexRegex of the ignored URLs. Ignore those that looks like a file by default.
publicYour public folder to start from.
scripts: Base path of your AngularJS scripts.Default to /js
scriptsReplaceThe text to replace by the scripts tag. Can be a string or a regex.Default to <!-- APP SCRIPTS -->
app.use(serveAngular({
layout: __dirname + '/public/layout.html',
scriptsFolder: __dirname + '/public/js',
scriptsBase: '/app'
}));