var express = require('express');
var app = express();
app.get('/hello.txt', function(req, res){
res.send('Hello World');
});
app.listen(1337);
console.log('Listening on port 1337');
Connect Middleware
Middleware is basically a function which accepts request and response objects and a next function.
Usage: express [options] [dir]
Options:
-h, --help output usage information
-V, --version output the version number
-s, --sessions add session support
-e, --ejs add ejs engine support (defaults to jade)
-J, --jshtml add jshtml engine support (defaults to jade)
-H, --hogan add hogan.js engine support
-c, --css add stylesheet support (less|stylus) (defaults to plain css)
-f, --force force on non-empty directory
mongod // start the mongo server
mongo // start the CLI
help // show help contents
show collections
use newdb // make the DB on the fly
show collections // show the collections in the DB
db.collection1.save({1: 'a', 2: 'b'});
db.collection1.find(); // return all documents
db.collection1.find({1: 'a'}); // search for documents