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

controller

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

controller - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

lib/controller.js

@@ -57,3 +57,3 @@ var isRegExp = require('util').isRegExp;

if (!isRegExp(path) && self.options.prefix) {
path = join(options.prefix, path);
path = join(self.options.prefix, path);
}

@@ -60,0 +60,0 @@ app[route.method](path, middleware, action.handler);

{
"name": "controller",
"version": "0.2.0",
"version": "0.2.1",
"description": "an action controller for express",

@@ -5,0 +5,0 @@ "main": "lib/controller.js",

@@ -38,2 +38,19 @@ var assert = require('assert');

});
it('should route with a prefix', function() {
var c = ctrl({prefix: '/prefix/'});
var action = function someAction(){};
var doThing = function thing(){};
c.define('action', ['thing'], action);
c.route('GET', '/action', 'action');
var anapp = app();
var didCall = false;
anapp.on('get', function(route, mw, theAction) {
assert(route === '/prefix/action');
didCall = true;
});
c.attach(anapp);
assert(didCall === true);
});
describe('direct()', function() {

@@ -40,0 +57,0 @@ it('should allow direct attachment', function() {

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