Package Exports
- lime-static
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lime-static) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
lime-static
About
This is a simple static file router for OWIN-JS REST framework for the limerun project
Installation
$ npm install lime-staticUsage
var static = require('lime-static');
app.use(static(filePath, options));Options
maxageBrowser cache max-age in milliseconds. defaults to 0hiddenAllow transfer of hidden files. defaults to falseindexDefault file name, defaults to 'index.html'deferIf true, serves afteryield next, allowing any downstream middleware to respond firstsyncIf true uses node fs synchronous calls, if false uses asynchronous
Example
// Dependencies
const lime = require('limerun')
, static = require('lime-static')
, http = require('http');
// Create Factories
var app = new lime.app();
// App
app.use(static('.'));
http.createServer(app.buildHttp()).listen(8000);Example with mount location
// Dependencies
const lime = require('limerun')
, static = require('lime-static')
, http = require('http');
// Create Factories
var app = new lime.app();
// Mount app to map URL /bootstrap to file system directory \lib\vendor\bootstrap
app.mount('/bootstrap', function(applet){
applet.use(static('./lib/vendor/bootstrap', {sync:true}));
});
// Run app using standard owinJS host
http.createServer(app.buildHttp()).listen(8000);License
Apache 2.0
