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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.11latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.11
0.2.01
0.1.10
0.1.00

Package Sidebar

Install

npm i serve-angular

Weekly Downloads

2

Version

0.2.1

License

MIT

Last publish

Collaborators

  • exon