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

otto-app

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

otto-app - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

35

lib/index.js

@@ -5,2 +5,3 @@

// Modules
var async = require('async');
var express = require('express');

@@ -19,6 +20,4 @@ var socketio = require('socket.io');

// TODO: Add configuration options
// Add WebSockets
var io = socketio();
app.socketio = io;
app.socketio = socketio();

@@ -28,3 +27,2 @@ // Global Settings

// TODO: Add configuration option
// Serve static files before the routes

@@ -35,27 +33,20 @@ if (options.static) {

// Remove Header X-Powered-By
app.disable('x-powered-by');
// Ensure req.locals exists
app.use(function (req, res, next) {
if (!req.locals) { req.locals = {}; }
next();
});
// Attach Routes
// Attach Routes Asynchronously
if (options.routes) {
if (!Array.isArray(options.routes)) { return new Error('options.routes needs to be an Array'); }
for (var i = 0; i < options.routes.length; i++) {
options.routes[i] (app);
}
}
async.mapSeries(options.routes, function (route, done) {
route(app, done);
}, function (error) {
// Catch-All Route (Not Found)
app.use(response.not_found);
// Catch-All Route (Not Found)
app.use(response.not_found);
// Error Handler
app.use(response.failure);
// Error Handler
app.use(response.failure);
});
}
return app;
};
{
"name" : "otto-app",
"version" : "0.2.0",
"version" : "0.3.0",
"repository" : "https://github.com/ottojs/otto-app.git",
"main" : "./lib/index.js",
"dependencies" : {
"async" : "1.4.2",
"express" : "4.13.3",
"socket.io" : "1.3.6",
"otto-errors" : "0.2.0",
"otto-config" : "0.2.0",
"otto-config" : "0.3.0",
"otto-response" : "0.4.0"

@@ -12,0 +13,0 @@ },

@@ -28,3 +28,6 @@

subject({
routes : [ function (app) {} ]
routes : [
function (app, done) { done(); },
function (app, done) { done(); }
]
}).should.have.property('get').and.be.type('function');

@@ -31,0 +34,0 @@ });

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