0.0.5 • Published 8 years ago

mini-route v0.0.5

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

mini-route

A little mini-router for Node.

This is a pretty simple, nonintrusive module that handles http (or https) routing. Example:

var http = require('http');
var MiniRoute = require('mini-route');

var server = http.createServer();
var router = new MiniRoute(server);

router.get('/', function(req, res) {
  res.end('Hello, world!');
});

server.listen(8080);

This simply attaches itself to the server's request event and processes the routes.

Options

You can also add an options object like so:

var router = new MiniRoute(server, {
  // opts
});

Available options:

  • notFound - Should return 404 when the route isn't found?

Great, but, why not use Express?

Sure, Express is great, but, at times I feel it's too bloated. Personally, I try to use as little modules as possible, and part of the reason I do that is because most modules feel like they try to provide a lot more than what I really need. Express is one of those modules. That's why I made this!

0.0.5

8 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago