0.0.1 • Published 8 years ago

restify-mw v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

restify-mw


A collection of customized middleware for node-restify

Documentation


restifymw.serveStatic( options )

Example

var restifymw = require('restify-mw');

// restify initialization code...

// create a route for http://host/js/vendor/*
server.get(/\/js\/vendor\/?.*/, restifymw.serveStatic({
    directory: __dirname + '/bower_components',
    virtual: '/js/vendor'
}));

// files are all served out of /module_path/bower_components
// i.e. route http://host/js/vendor/angular/angular.min.js 
// serves file /module_path/bower_components/angular/angular.min.js

Tools

Created with Nodeclipse (Eclipse Marketplace, site)

Nodeclipse is free open-source project that grows with your contributions.