New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

journey

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

journey - npm Package Compare versions

Comparing version 0.4.0-pre-2 to 0.4.0-pre-3

21

example/http-server.js

@@ -1,14 +0,15 @@

var path = require('path'),
sys = require('sys');
var util = require('util');
require.paths.unshift(path.join(__dirname, '..', 'lib'));
var journey = require('../lib/journey');
var journey = require('journey');
//
// Create a Router object with an associated routing table
//
var router = new(journey.Router)(function (map) {
map.root.bind(function (res) { res.send("Welcome") }); // GET '/'
map.get('/version').bind(function (res) {
var router = new(journey.Router);
router.map(function () {
this.root.bind(function (req, res) { // GET '/'
res.send(200, {}, "Welcome");
});
this.get('/version').bind(function (req, res) {
res.send(200, {}, { version: journey.version.join('.') });

@@ -26,3 +27,3 @@ });

//
router.route(request, body, function (result) {
router.handle(request, body, function (result) {
response.writeHead(result.status, result.headers);

@@ -34,2 +35,2 @@ response.end(result.body);

sys.puts('journey listening at http://127.0.0.1:8080');
util.puts('journey listening at http://127.0.0.1:8080');
var path = require('path');
require.paths.unshift(__dirname);
var http = require("http"),
events = require('events'),
url = require('url');
var sys = require("sys"),
http = require("http"),
events = require('events'),
fs = require("fs"),
url = require('url');
var querystring = require('querystring');
var errors = require('journey/errors');
var errors = require('./journey/errors');

@@ -32,2 +28,3 @@ // Escape RegExp characters in a string

strictUrls: true,
ignoreCase: false,
api: 'http'

@@ -89,3 +86,3 @@ };

pattern = this.paths.length ? '' : /.*/,
ignoreCase = false,
ignoreCase = this.options.ignoreCase,
method = journey.Router.methods.slice(0),

@@ -185,3 +182,3 @@ constraints = [],

if (typeof(outcome.body) !== 'string') {
outcome.headers["Content-Type"] = "application/json";
outcome.headers["Content-Type"] = "application/json;charset=utf-8";
outcome.body = JSON.stringify(outcome.body);

@@ -217,3 +214,3 @@ }

if (! path) { return new(BadRequest) }
if (! path) { return new(journey.BadRequest) }

@@ -371,3 +368,3 @@ return (path.length > 1 ? path.slice(1) : path).match(pattern);

body: "",
headers: {"Content-Type" : "application/json"}
headers: {"Content-Type" : "application/json;charset=utf-8"}
},

@@ -374,0 +371,0 @@

@@ -12,5 +12,5 @@ {

"main" : "./lib/journey",
"version" : "0.4.0-pre-2",
"version" : "0.4.0-pre-3",
"directories" : { "test": "./test" },
"engines" : { "node": "> 0.2.6" }
}

@@ -29,3 +29,3 @@ journey

});
};
});
this.post('/trolls').bind(function (req, res, data) {

@@ -32,0 +32,0 @@ sys.puts(data.type); // "Cave-Troll"

@@ -1,14 +0,9 @@

var sys = require('sys'),
http = require('http'),
assert = require('assert'),
path = require('path'),
events = require('events'),
url = require('url');
var http = require('http'),
assert = require('assert'),
events = require('events');
var vows = require('vows');
require.paths.unshift(__dirname, path.join(__dirname, '..'));
var journey = require('../lib/journey');
var journey = require('lib/journey');
var resources = {

@@ -114,3 +109,3 @@ "home": {

var mock = require('lib/journey/mock-request').mock(router);
var mock = require('../lib/journey/mock-request').mock(router);

@@ -117,0 +112,0 @@ var get = mock.get,

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