Skip to content

RestAPI System with Mongoose and Node/Express

Notifications You must be signed in to change notification settings

ayxos/node_APIrest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
cybermarkus1
Feb 7, 2014
9a9362e · Feb 7, 2014

History

45 Commits
Feb 7, 2014
Feb 7, 2014
Feb 7, 2014
Jan 30, 2014
Feb 6, 2014
Feb 7, 2014
Jan 30, 2014

Repository files navigation

RestAPI System with Mongoose and Node/Express

RestAPI System with Mongoose and Node/Express

Demo web: http://ayxos.com:8001/

Spanish explanation is here: http://ayxos.com/como-crear-una-web-apirest-con-node-js-y-no-morir-en-el-intento/

It's very simple

cd express_example && npm install

This will install packages and you will see a lot of output. When this is complete you can boot your application.

Boot the app

That's all the setup you need. Phew. Now you can boot the app:

npm install -g express
express -c stylus express_example
node app.js
  • Adding mongoose driver to conect node and mongoDB -> package.json
  • Create a file called db.js for db schema
  • insert db.js path at top of app.js
  • redo index.js to connect with new mongo DB

#New_features

  • Adding restAPI CRUD methods
  • New db_model
  • Delete Method is working using a HACK get method
  • Adding nodemon, similar to grunt watch, there's no need to restart server, it does automatically
  • Adding pm2 to keep server alive

Basic mongo commands

show dbs
use dbs_name
db.dropDatabase();
show collections
db.collection_name.find().pretty()
db.collection_name.drop()

About

RestAPI System with Mongoose and Node/Express

ayxos.com:8001

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published