Just a basic API running with Express and Mongoose
MIT License
Everyone needs an API these days, am I right? So, this is a basic API (as the name says) with a nice M(V)C structure.
Built with Express and Mongoose, and ES6 Promises.
No more Mongoose Callbacks
'Cause if you liked it, then you should have put a star on it.
http://okbel.github.io/basicAPI/
$ git clone https://github.com/okbel/basicAPI.git
$ npm install
$ sudo mongod
$ npm start
GET: http://localhost:3000/posts/
GET: http://localhost:3000/posts/<id>
GET: http://localhost:3000/posts?<field>=<value>&limit=<number>
For example: http://localhost:3000/posts?hidden=1&limit=2
POST: http://localhost:3000/posts
Parameters:
- title
- author
- body
(Check Schema)
DEL: http://localhost:3000/posts/<id>
PUT: http://localhost:3000/posts/<id>
Parameters:
- title
- author
- body
(Check Schema)
Theres a couple of TODOs, I will add more validations and make it a bit more secure.
TODOS:
Enjoy, B.