
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Courser is a route manager for express web framework, provides an easy way to manage routes.
Using NPM to install Courser module directly:
npm install courser
A small example of managing routes for express:
<Working Directory>/app.js
var express = require('express');
var Courser = require('courser');
var app = express.createServer();
app.configure(function() {
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
});
// Loading and Initializing Routes from specific path
var courser = new Courser(app);
courser.addPath(__dirname + '/routes');
courser.init(function() {
app.listen(3000);
});
<Working Directory>/routes/default.js
module.exports = {
'/': index,
'/hello': hello
};
function index(req, res) {
res.render('index', { title: 'Courser Example' });
};
function hello(req, res, next) {
res.render('hello', { title: 'Hello' });
};
<Working Directory>/routes/other.js
module.exports = {
'/other': other
};
function other(req, res) {
res.render('other', { title: 'Courser Example Two' });
};
All of JavaScript files(*.js) in specific path will be loaded by Courser. Developer can add more APIs or pages to existing files or new file.
module.exports = {
'/middleware': [
DoSomethingBeforeHandler,
middleware
]
};
function DoSomethingBeforeHandler(req, res, next) {
console.log('Do Something');
next();
};
function middleware(req, res) {
res.render('index', { title: 'Courser Example' });
};
module.exports = {
'/method': {
get: get,
post: post
}
};
function get(req, res) {
res.end('GET Method');
};
function post(req, res) {
res.end('POST Method');
};
Licensed under the MIT License
Copyright© 2012 Fred Chien <fred@mandice.com>
FAQs
Route manager for express web framework
We found that courser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.