Skip to content

Latest commit

 

History

History
79 lines (50 loc) · 1.14 KB

README.md

File metadata and controls

79 lines (50 loc) · 1.14 KB

Express + Mongoose Demo

A simple but well tested demo of a web application by express and mongoose.

This application includes:

  • easy to understand MVC architecture.
  • save and manage bookmarks(url)
  • CRUD support by Mongoose
  • simple RESTful interface([GET|POST|PUT|DELETE] /bookmark)
  • unit tested over http by Mocha + Supertest + should.js
  • all tasks are written in Gruntfile.js

install

git clone [email protected]:FL4TLiN3/express-mongoose-demo.git
cd express-mongoose-demo
mkdir log
npm install -l
mkdir node_modules/share
ln -s lib/share.js node_modules/share/index.html

how to run

grunt nodemon

then your RESTful server is standing by.

you can access:

GET /bookmarks

list of all bookmarks.

GET /bookmark/:bookmarkID

show specified bookmark.

@param

  • bookmarkID

POST /bookmark

save a bookmark.

@param

  • url

PUT /bookmark/:bookmarkID

update specified bookmark.

@param

  • bookmarkID

DELETE /bookmark/:bookmarkID

delete specified bookmark.

@param

  • bookmarkID

test

grunt simplemocha

# or

grunt test # this command gonna watch test-target files

license

MIT