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
| bunyan = require 'bunyan' | |
| restify = require 'restify' | |
| requireDir = require 'require-dir' | |
| middleware = requireDir './middleware' | |
| routes = requireDir './routes' | |
| settings = require './settings' | |
| app = restify.createServer | |
| name: 'Foo Bar API' |
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
| // preserve Twitter's style of JSON string encoding... | |
| // escape higher value unicode (lowercase hex) | |
| // escape < and > (uppercase hex) | |
| // escape / in strings (\/) | |
| // hugs! https://gist.github.com/1306986 | |
| // http://stackoverflow.com/questions/4901133/json-and-escaping-characters | |
| function escapedStringify(s, emit_unicode) { | |
| var json = JSON.stringify(s); | |
| return emit_unicode ? json : json.replace(/\//g, | |
| function(c) { |
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
| var express = require('express'), | |
| requirejs = require('requirejs'), | |
| app = module.exports = express.createServer(); | |
| app.configure('development', function(){ | |
| // Use development version of static files | |
| app.use(express.static(__dirname + '/public')); | |
| }); | |
| app.configure('production', function(){ |
OlderNewer