0.1.4 • Published 11 years ago

express-route v0.1.4

Weekly downloads
9
License
-
Repository
github
Last release
11 years ago

express-route

express-route is a library that let you organize the routes for the express applications.

Usage

var route = require('express-route');

// app is a reference to an express application
// './routes' is a path to the directory with routes
// the third parameter is a configuration object
route(app, './routes', {
	// retrieve routes synchronously
	sync: true,

	// action to invoke when route is marked as restricted: true
	ensureRestriction: function (req, res, next) {
		if (!user.authorized) {
			res.status(403).end('Forbidden');
			return;
		}
		next();
	}
});

More examples you can find in the tests directory.

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago