Skip to content

Instantly share code, notes, and snippets.

@melito
Created July 29, 2010 21:10
Show Gist options
  • Select an option

  • Save melito/499242 to your computer and use it in GitHub Desktop.

Select an option

Save melito/499242 to your computer and use it in GitHub Desktop.
Requires
========
require.paths.unshift(__dirname + '/vendor/express/support/connect/lib');
require.paths.unshift(__dirname + '/vendor/express/support/ejs/lib');
require.paths.unshift(__dirname + '/vendor/express/lib');
require.paths.unshift(__dirname + '/vendor/node-mongodb-native/lib');
require.paths.unshift(__dirname + '/models');
var sys = require('sys'),
fs = require('fs'),
connect = require('connect'),
express = require('express'),
mongo = require('mongodb'),
restaurant = require('restaurant');
Tree
=====
.
|-- Rakefile
|-- config
| `-- app.json
|-- logs
|-- models
| `-- restaurant.js
|-- pids
|-- public
| |-- images
| |-- javascripts
| `-- stylesheets
| |-- style.css
| `-- style.sass
|-- server.js
|-- vendor
| |-- express
| | |-- History.md
| | |-- Makefile
| | |-- Readme.md
| | |-- bin
| | | `-- express
| | |-- docs
| | | |-- api.html
| | | |-- contrib.1
| | | |-- contrib.html
| | | |-- contrib.md
| | | |-- executable.1
| | | |-- executable.html
| | | |-- executable.md
| | | |-- guide.1
| | | |-- guide.html
| | | |-- guide.md
| | | |-- images
| | | | |-- bg.jpg
| | | | |-- bg.tile.jpg
| | | | |-- logo.png
| | | | `-- top.png
| | | |-- index.1
| | | |-- index.html
| | | |-- index.md
| | | |-- layout
| | | | |-- foot.html
| | | | `-- head.html
| | | |-- migrate.1
| | | |-- migrate.html
| | | `-- migrate.md
| | |-- examples
| | | |-- blog
| | | | |-- app.js
| | | | |-- blog
| | | | | |-- index.js
| | | | | |-- posts.json
| | | | | `-- views
| | | | | |-- index.ejs
| | | | | |-- layout.ejs
| | | | | |-- partials
| | | | | | `-- post.ejs
| | | | | `-- post.ejs
| | | | |-- contact.js
| | | | `-- main.js
| | | |-- ejs
| | | | |-- app.js
| | | | `-- views
| | | | |-- layout.ejs
| | | | |-- partials
| | | | | `-- user.ejs
| | | | `-- users.ejs
| | | |-- error
| | | | `-- app.js
| | | |-- form
| | | | `-- app.js
| | | |-- github
| | | | |-- app.js
| | | | |-- public
| | | | | `-- style.css
| | | | `-- views
| | | | |-- index.jade
| | | | |-- layout.jade
| | | | `-- partials
| | | | `-- repo.jade
| | | |-- helloworld
| | | | `-- app.js
| | | |-- jade
| | | | |-- app.js
| | | | |-- public
| | | | | `-- stylesheets
| | | | | |-- style.css
| | | | | `-- style.sass
| | | | `-- views
| | | | |-- layout.jade
| | | | |-- partials
| | | | | `-- user.jade
| | | | `-- users.jade
| | | |-- multipart
| | | | `-- app.js
| | | |-- pages
| | | | |-- app.js
| | | | `-- views
| | | | |-- 404.jade
| | | | |-- 500.jade
| | | | |-- index.jade
| | | | `-- layout.jade
| | | |-- resource
| | | | `-- app.js
| | | `-- session
| | | `-- app.js
| | |-- index.js
| | |-- install.sh
| | |-- lib
| | | `-- express
| | | |-- index.js
| | | |-- request.js
| | | |-- response.js
| | | |-- server.js
| | | |-- utils.js
| | | `-- view.js
| | |-- package.json
| | |-- support
| | | |-- connect
| | | | |-- History.md
| | | | |-- Makefile
| | | | |-- README.md
| | | | |-- benchmarks
| | | | | |-- graph
| | | | | |-- hello-world
| | | | | | |-- connect.js
| | | | | | |-- node.js
| | | | | | |-- rack.thin.ru
| | | | | | `-- sinatra.thin.ru
| | | | | |-- public
| | | | | | `-- jquery.js
| | | | | |-- run
| | | | | `-- static
| | | | | |-- connect.js
| | | | | |-- node.js
| | | | | `-- sinatra.thin.ru
| | | | |-- docs
| | | | | |-- api.html
| | | | | |-- bodyDecoder.1
| | | | | |-- bodyDecoder.html
| | | | | |-- bodyDecoder.md
| | | | | |-- compiler.1
| | | | | |-- compiler.html
| | | | | |-- compiler.md
| | | | | |-- conditionalGet.1
| | | | | |-- conditionalGet.html
| | | | | |-- conditionalGet.md
| | | | | |-- cookieDecoder.1
| | | | | |-- cookieDecoder.html
| | | | | |-- cookieDecoder.md
| | | | | |-- errorHandler.1
| | | | | |-- errorHandler.html
| | | | | |-- errorHandler.md
| | | | | |-- format.1
| | | | | |-- format.html
| | | | | |-- format.md
| | | | | |-- index.1
| | | | | |-- index.html
| | | | | |-- index.md
| | | | | |-- jsonrpc.1
| | | | | |-- jsonrpc.html
| | | | | |-- jsonrpc.md
| | | | | |-- layout
| | | | | | |-- api.foot.html
| | | | | | `-- api.head.html
| | | | | |-- lint.1
| | | | | |-- lint.html
| | | | | |-- lint.md
| | | | | |-- logger.1
| | | | | |-- logger.html
| | | | | |-- logger.md
| | | | | |-- methodOverride.1
| | | | | |-- methodOverride.html
| | | | | |-- methodOverride.md
| | | | | |-- responseTime.1
| | | | | |-- responseTime.html
| | | | | |-- responseTime.md
| | | | | |-- router.1
| | | | | |-- router.html
| | | | | |-- router.md
| | | | | |-- session.1
| | | | | |-- session.html
| | | | | |-- session.md
| | | | | |-- staticProvider.1
| | | | | |-- staticProvider.html
| | | | | `-- staticProvider.md
| | | | |-- examples
| | | | | |-- embedding
| | | | | | |-- app.js
| | | | | | `-- server.js
| | | | | |-- error
| | | | | | `-- app.js
| | | | | |-- hello-world
| | | | | | `-- app.js
| | | | | |-- jsonrpc
| | | | | | `-- app.js
| | | | | |-- less
| | | | | | |-- app.js
| | | | | | `-- public
| | | | | | |-- index.html
| | | | | | `-- style.less
| | | | | |-- lint
| | | | | | `-- app.js
| | | | | |-- multitouch
| | | | | | |-- app.js
| | | | | | `-- public
| | | | | | |-- client.js
| | | | | | |-- favicon.ico
| | | | | | |-- index.html
| | | | | | |-- raphael.js
| | | | | | `-- style.css
| | | | | |-- router
| | | | | | `-- app.js
| | | | | |-- sass
| | | | | | |-- app.js
| | | | | | `-- public
| | | | | | |-- index.html
| | | | | | `-- style.sass
| | | | | |-- session
| | | | | | `-- app.js
| | | | | |-- stack-middleware
| | | | | | |-- app.js
| | | | | | |-- hello.js
| | | | | | `-- world.js
| | | | | |-- static
| | | | | | |-- app.js
| | | | | | `-- public
| | | | | | `-- style.css
| | | | | |-- url-rewrite
| | | | | | `-- app.js
| | | | | `-- vhost
| | | | | `-- app.js
| | | | |-- install.sh
| | | | |-- lib
| | | | | `-- connect
| | | | | |-- index.js
| | | | | |-- middleware
| | | | | | |-- bodyDecoder.js
| | | | | | |-- cache.js
| | | | | | |-- cacheManifest.js
| | | | | | |-- compiler.js
| | | | | | |-- conditionalGet.js
| | | | | | |-- cookieDecoder.js
| | | | | | |-- errorHandler.js
| | | | | | |-- format.js
| | | | | | |-- gzip-compress.js
| | | | | | |-- gzip-proc.js
| | | | | | |-- gzip.js
| | | | | | |-- jsonrpc.js
| | | | | | |-- lint.js
| | | | | | |-- logger.js
| | | | | | |-- methodOverride.js
| | | | | | |-- pubsub.js
| | | | | | |-- repl.js
| | | | | | |-- responseTime.js
| | | | | | |-- router.js
| | | | | | |-- session
| | | | | | | |-- memory.js
| | | | | | | |-- session.js
| | | | | | | `-- store.js
| | | | | | |-- session.js
| | | | | | |-- staticProvider.js
| | | | | | `-- vhost.js
| | | | | |-- public
| | | | | | |-- error.html
| | | | | | `-- style.css
| | | | | |-- response.js
| | | | | `-- utils.js
| | | | |-- package.json
| | | | |-- support
| | | | | |-- expresso
| | | | | |-- highlight.js
| | | | | |-- koala
| | | | | |-- less
| | | | | `-- sass
| | | | `-- test
| | | | |-- bodyDecoder.test.js
| | | | |-- compiler.test.js
| | | | |-- connect.test.js
| | | | |-- cookieDecoder.test.js
| | | | |-- errorHandler.test.js
| | | | |-- filters
| | | | | `-- uppercase.js
| | | | |-- fixtures
| | | | | |-- foo.bar.baz.sass
| | | | | |-- index.html
| | | | | |-- some text.txt
| | | | | |-- style.less
| | | | | |-- style.sass
| | | | | `-- user.json
| | | | |-- format.test.js
| | | | |-- gzip.test.js
| | | | |-- helpers
| | | | | |-- http.js
| | | | | `-- index.js
| | | | |-- jsonrpc.test.js
| | | | |-- logger.test.js
| | | | |-- methodOverride.test.js
| | | | |-- providers
| | | | | `-- echo.js
| | | | |-- responseTime.test.js
| | | | |-- router.test.js
| | | | |-- session.test.js
| | | | |-- static.test.js
| | | | |-- utils.test.js
| | | | `-- vhost.test.js
| | | |-- connect-form
| | | | |-- History.md
| | | | |-- Makefile
| | | | |-- Readme.md
| | | | |-- index.html
| | | | |-- index.js
| | | | |-- package.json
| | | | |-- support
| | | | | `-- expresso
| | | | `-- test
| | | | `-- form.test.js
| | | |-- ejs
| | | | |-- History.md
| | | | |-- Makefile
| | | | |-- Readme.md
| | | | |-- index.js -> lib/ejs.js
| | | | |-- lib
| | | | | `-- ejs.js
| | | | |-- package.json
| | | | |-- support
| | | | | `-- expresso
| | | | `-- test
| | | | `-- ejs.test.js
| | | |-- expresso
| | | | |-- History.md
| | | | |-- Makefile
| | | | |-- Readme.md
| | | | |-- bin
| | | | | `-- expresso
| | | | |-- deps
| | | | | `-- jscoverage
| | | | |-- lib
| | | | | |-- bar.js
| | | | | `-- foo.js
| | | | |-- package.json
| | | | `-- test
| | | | |-- assert.test.js
| | | | |-- async.test.js
| | | | |-- bar.test.js
| | | | |-- foo.test.js
| | | | `-- http.test.js
| | | |-- haml
| | | | |-- History.md
| | | | |-- Makefile
| | | | |-- Readme.md
| | | | |-- benchmarks
| | | | | |-- haml-js
| | | | | |-- page.haml
| | | | | `-- run.js
| | | | |-- examples
| | | | | |-- example.js
| | | | | `-- page.haml
| | | | |-- index.js -> lib/haml.js
| | | | |-- lib
| | | | | `-- haml.js
| | | | |-- package.json
| | | | |-- seed.yml
| | | | `-- spec
| | | | |-- fixtures
| | | | | |-- class.haml
| | | | | |-- class.html
| | | | | |-- classes.haml
| | | | | |-- classes.html
| | | | | |-- code.each.haml
| | | | | |-- code.each.html
| | | | | |-- code.each.index.haml
| | | | | |-- code.each.index.html
| | | | | |-- code.each.non-enumerable.haml
| | | | | |-- code.each.non-enumerable.html
| | | | | |-- code.escape.haml
| | | | | |-- code.escape.html
| | | | | |-- code.haml
| | | | | |-- code.html
| | | | | |-- code.if.haml
| | | | | |-- code.if.html
| | | | | |-- code.nested.haml
| | | | | |-- code.nested.html
| | | | | |-- comment.block.conditional.haml
| | | | | |-- comment.block.conditional.html
| | | | | |-- comment.block.haml
| | | | | |-- comment.block.html
| | | | | |-- comment.haml
| | | | | |-- comment.html
| | | | | |-- comment.tag.haml
| | | | | |-- comment.tag.html
| | | | | |-- comment.text.complex.haml
| | | | | |-- comment.text.complex.html
| | | | | |-- comment.text.haml
| | | | | |-- comment.text.html
| | | | | |-- context.haml
| | | | | |-- context.html
| | | | | |-- cr.haml
| | | | | |-- cr.html
| | | | | |-- crlf.haml
| | | | | |-- crlf.html
| | | | | |-- doctype.haml
| | | | | |-- doctype.html
| | | | | |-- doctype.xml.case.haml
| | | | | |-- doctype.xml.case.html
| | | | | |-- doctype.xml.haml
| | | | | |-- doctype.xml.html
| | | | | |-- error.haml
| | | | | |-- escape.haml
| | | | | |-- escape.html
| | | | | |-- feed.haml
| | | | | |-- feed.xml
| | | | | |-- filter.cdata.haml
| | | | | |-- filter.cdata.html
| | | | | |-- filter.cdata.whitespace.haml
| | | | | |-- filter.cdata.whitespace.html
| | | | | |-- filter.javascript.haml
| | | | | |-- filter.javascript.html
| | | | | |-- filter.plain.haml
| | | | | |-- filter.plain.html
| | | | | |-- html.haml
| | | | | |-- html.html
| | | | | |-- id.haml
| | | | | |-- id.html
| | | | | |-- issue.#10.haml
| | | | | |-- issue.#10.html
| | | | | |-- issue.#8.haml
| | | | | |-- issue.#8.html
| | | | | |-- literals.haml
| | | | | |-- literals.html
| | | | | |-- namespace.haml
| | | | | |-- namespace.tag.haml
| | | | | |-- namespace.tag.html
| | | | | |-- namespace.xml
| | | | | |-- nesting.complex.haml
| | | | | |-- nesting.complex.html
| | | | | |-- nesting.simple.haml
| | | | | |-- nesting.simple.html
| | | | | |-- newlines.haml
| | | | | |-- newlines.html
| | | | | |-- tag.attrs.bools.haml
| | | | | |-- tag.attrs.bools.html
| | | | | |-- tag.attrs.escape.haml
| | | | | |-- tag.attrs.escape.html
| | | | | |-- tag.attrs.haml
| | | | | |-- tag.attrs.html
| | | | | |-- tag.class.haml
| | | | | |-- tag.class.html
| | | | | |-- tag.classes.haml
| | | | | |-- tag.classes.html
| | | | | |-- tag.code.haml
| | | | | |-- tag.code.html
| | | | | |-- tag.code.no-escape.haml
| | | | | |-- tag.code.no-escape.html
| | | | | |-- tag.complex.haml
| | | | | |-- tag.complex.html
| | | | | |-- tag.empty.haml
| | | | | |-- tag.empty.html
| | | | | |-- tag.escape.haml
| | | | | |-- tag.escape.html
| | | | | |-- tag.self-close.haml
| | | | | |-- tag.self-close.html
| | | | | |-- tag.simple.haml
| | | | | |-- tag.simple.html
| | | | | |-- tag.text.block.complex.haml
| | | | | |-- tag.text.block.complex.html
| | | | | |-- tag.text.block.haml
| | | | | |-- tag.text.block.html
| | | | | |-- tag.text.haml
| | | | | |-- tag.text.html
| | | | | |-- trailing-indent.haml
| | | | | `-- trailing-indent.html
| | | | |-- lib
| | | | | |-- images
| | | | | | |-- bg.png
| | | | | | |-- hr.png
| | | | | | |-- loading.gif
| | | | | | |-- sprites.bg.png
| | | | | | |-- sprites.png
| | | | | | `-- vr.png
| | | | | |-- jspec.css
| | | | | |-- jspec.growl.js
| | | | | |-- jspec.jquery.js
| | | | | |-- jspec.js
| | | | | |-- jspec.nodejs.js
| | | | | |-- jspec.shell.js
| | | | | |-- jspec.timers.js
| | | | | `-- jspec.xhr.js
| | | | |-- node.js
| | | | `-- unit
| | | | |-- spec.helper.js
| | | | `-- spec.js
| | | |-- jade
| | | | |-- CNAME
| | | | |-- History.md
| | | | |-- Makefile
| | | | |-- Readme.md
| | | | |-- api.html
| | | | |-- bin
| | | | | `-- jade
| | | | |-- examples
| | | | | |-- interpolation.jade
| | | | | |-- iteration.jade
| | | | | |-- layout.jade
| | | | | |-- markdown.jade
| | | | | |-- run.js
| | | | | |-- users.jade
| | | | | `-- whitespace.jade
| | | | |-- lib
| | | | | `-- jade.js
| | | | |-- package.json
| | | | |-- seed.yml
| | | | |-- support
| | | | | |-- expresso
| | | | | `-- markdown
| | | | `-- test
| | | | |-- filters.test.js
| | | | |-- fixtures
| | | | | |-- invalid.jade
| | | | | `-- layout.jade
| | | | `-- jade.test.js
| | | `-- toc.js
| | `-- test
| | |-- express.test.js
| | |-- fixtures
| | | |-- cool-layout.jade
| | | |-- dynamic-helpers.jade
| | | |-- hello.haml
| | | |-- index.jade
| | | |-- invalid.jade
| | | |-- items.jade
| | | |-- layout.jade
| | | |-- layouts
| | | | `-- foo.jade
| | | |-- movies.jade
| | | |-- partials
| | | | |-- hello.ejs
| | | | |-- item.jade
| | | | |-- magic.jade
| | | | |-- movie.jade
| | | | |-- person.jade
| | | | |-- user.jade
| | | | `-- video.jade
| | | |-- scope.jade
| | | `-- user.json
| | |-- request.test.js
| | |-- response.test.js
| | |-- utils.test.js
| | `-- view.test.js
| `-- node-mongodb-native
| |-- HISTORY
| |-- Makefile
| |-- README.rdoc
| |-- benchmark
| | |-- grid_fs_write_benchmark.js
| | `-- streaming_benchmark.js
| |-- examples
| | |-- admin.js
| | |-- blog.js
| | |-- capped.js
| | |-- cursor.js
| | |-- gridfs.js
| | |-- index_test.js
| | |-- info.js
| | |-- queries.js
| | |-- simple.js
| | |-- strict.js
| | |-- types.js
| | `-- url.js
| |-- integration
| | |-- integration_tests.js
| | |-- test_gs_weird_bug.png
| | `-- test_gs_working_field_read.pdf
| |-- lib
| | `-- mongodb
| | |-- admin.js
| | |-- bson
| | | |-- binary_parser.js
| | | |-- bson.js
| | | `-- collections.js
| | |-- collection.js
| | |-- commands
| | | |-- base_command.js
| | | |-- db_command.js
| | | |-- delete_command.js
| | | |-- get_more_command.js
| | | |-- insert_command.js
| | | |-- kill_cursor_command.js
| | | |-- query_command.js
| | | `-- update_command.js
| | |-- connection.js
| | |-- crypto
| | | `-- md5.js
| | |-- cursor.js
| | |-- db.js
| | |-- goog
| | | `-- math
| | | |-- integer.js
| | | `-- long.js
| | |-- gridfs
| | | |-- chunk.js
| | | `-- gridstore.js
| | |-- index.js
| | `-- responses
| | `-- mongo_reply.js
| |-- package.json
| |-- seed.yml
| `-- spec
| |-- lib
| | |-- images
| | | |-- bg.png
| | | |-- hr.png
| | | |-- loading.gif
| | | |-- sprites.bg.png
| | | |-- sprites.png
| | | `-- vr.png
| | |-- jspec.css
| | |-- jspec.growl.js
| | |-- jspec.jquery.js
| | |-- jspec.js
| | |-- jspec.shell.js
| | |-- jspec.timers.js
| | `-- jspec.xhr.js
| |-- spec.bson.js
| |-- spec.commands.js
| |-- spec.node.js
| `-- spec.objectid.js
`-- views
|-- index.ejs
|-- layout.ejs
|-- layout.jade
|-- partials
| `-- restaurants.ejs
|-- restaurant
| `-- new.ejs
`-- users
`-- new.ejs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment