Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regex-router

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regex-router - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

3

main.js

@@ -8,6 +8,5 @@ 'use strict'; /*jslint node: true, indent: 2, es5: true*/

Router.prototype.route = function(req, res) {
var route;
var m;
for (var i = 0, l = this.routes.length; i < l; i++) {
route = this.routes[i];
var route = this.routes[i];
if (route.http_method === undefined || route.http_method === req.method.toLowerCase()) {

@@ -14,0 +13,0 @@ m = req.url.match(route.regex);

{
"name": "regex-router",
"version": "0.1.5",
"version": "0.1.6",
"description": "Route http requests via regular expressions.",

@@ -18,3 +18,4 @@ "keywords": [

"main": "./index.js",
"license": "MIT",
"author": "Christopher Brown <io@henrian.com>"
}
# Regex-router
Regex-router is a simple Node.js library to simplify routing. And by simplify, I mean 39 lines of code.
Regex-router is a simple Node.js library to simplify routing. By simple, I mean 50 lines of code.
# Example
var fs = require('fs'),
http = require('http'),
Router = require('regex-router'),
r = new Router();
var fs = require('fs');
var http = require('http');
var Router = require('regex-router');
var r = new Router();

@@ -29,1 +29,5 @@ r.get(/^\/page\/(\w+)/, function(m, req, res) {

}).listen(80, 'localhost');
## License
Copyright © 2012-2013 Christopher Brown. [MIT Licensed](LICENSE).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc