This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get("/route", function(req, res, next){ | |
res.render("my-view", function(err, view){ | |
if(err) return next(err); | |
// Do something specific with the view | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies | |
*/ | |
var metric = require('metric-log') | |
, log = metric.context({fn: "requestLogger"}); | |
log.headers = log.context({at: "headers"}).debug(); | |
log.base = log.context({at: "base"}).debug(); | |
log.body = log.context({at: "body"}).debug(); | |
log.env = log.context({at: "env"}).debug(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies | |
*/ | |
var debug = require("debug") | |
, metric = require('metric-log'); | |
/** | |
* Log headers | |
*/ | |
var headers = metric.context({item: "headers"}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies | |
*/ | |
var cart = require("simple-cart"); | |
/** | |
* Expose the app | |
*/ | |
var app = module.exports = cart(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("client", function(){ | |
it("should get the root resource", function(done) { | |
client() | |
.end(function(err, root) { | |
if(err) return done(err); | |
should.exist(root.links); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies | |
*/ | |
var metric = require("metric-log"); | |
module.exports = function() { | |
// TODO what do we inherit from? | |
var parent = metric.context(); | |
return function metricLogger(req, res, next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_URL=mongo://... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies | |
*/ | |
var express = require("express") | |
, experiments = require("./experiments"); | |
var app = module.exports = express(); | |
/** | |
* Features |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module deps | |
*/ | |
var express = require("express") | |
, proxy = require("simple-http-proxy"); | |
var app = module.exports = express(); | |
app.configure(function() { | |
app.use(express.logger("dev")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies | |
*/ | |
var express = require("express") | |
, pivot = require("pivot"); | |
var app = module.exports = express(); | |
/** | |
* Experiments |