Skip to content

Instantly share code, notes, and snippets.

View DannyMcwaves's full-sized avatar
🏠
Working from home

Danny Mcwaves DannyMcwaves

🏠
Working from home
View GitHub Profile
@DannyMcwaves
DannyMcwaves / express.js
Created November 17, 2016 09:15 — forked from azat-co/express.js
Tutorial: REST API with Node.js and MongoDB using Mongoskin and Express.js
var express = require('express')
, mongoskin = require('mongoskin')
var app = express()
app.use(express.bodyParser())
var db = mongoskin.db('localhost:27017/test', {safe:true});
app.param('collectionName', function(req, res, next, collectionName){
req.collection = db.collection(collectionName)
@azat-co
azat-co / express.js
Last active August 19, 2018 03:30
Tutorial: REST API with Node.js and MongoDB using Mongoskin and Express.js
var express = require('express')
, mongoskin = require('mongoskin')
var app = express()
app.use(express.bodyParser())
var db = mongoskin.db('localhost:27017/test', {safe:true});
app.param('collectionName', function(req, res, next, collectionName){
req.collection = db.collection(collectionName)