Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Getting started with Node and Mongo

Beschreibung

A-Level node.js Notiz am Getting started with Node and Mongo, erstellt von James Drummond am 23/02/2015.
James Drummond
Notiz von James Drummond, aktualisiert more than 1 year ago
James Drummond
Erstellt von James Drummond vor mehr als 10 Jahre
25
0
1 2 3 4 5 (0)

Zusammenfassung der Ressource

Seite 1

Great introduction to Express and mongo installation: http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/You need to 'mongod' from the command line - I think this is the Mongo daemon.Run 'mongo' from the command line to get a console from which you can run mongo commands.Connect to the database in app.js:// Add Mongo connection var mongo = require('mongodb');var monk = require('monk'); // Allow easy queries on the databasevar db = monk('localhost:27017/nodetest1'); // Make our db accessible to our router // THIS CODE MUST BE AHEAD OF THE ROUTES CODE OR THE APP WILL NOT WORKapp.use(function(req,res,next){ req.db = db; next();}); app.use('/', routes); app.use('/users', users);

Zusammenfassung anzeigen Zusammenfassung ausblenden

0 Kommentare

There are no comments, be the first and leave one below:

ähnlicher Inhalt

RESTful Web Services with Express Framework and mongoose.
Angel Martínez Rodriguez
Tipos de bases de datos
Jeffrey Bedoya
Express basics
James Drummond
Mongo Db M101 JS
Muhammad Akif
MongoDB Notes
Callie Toothman
Mongoose and express
James Drummond
MongoDB Terms
Callie Toothman
Android RESTful client
Angel Martínez Rodriguez
Spanisch Einstufungstest Niveau B1.1
SprachschuleAktiv
Kabale und Liebe - Umfangreiche Lernfolien
Laura Overhoff