serve-angular

0.2.1 • Public • Published

NPM Version Build Status Test Coverage

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

ignoreRegex
Regex of the ignored URLs. Ignore those that looks like a file by default.

public
Your public folder to start from.

scripts: Base path of your AngularJS scripts.
Default to /js

scriptsReplace
The 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'
}));

License

MIT

Package Sidebar

Install

npm i serve-angular

Weekly Downloads

1

Version

0.2.1

License

MIT

Last publish

Collaborators

  • exon