Skip to content

MongoDB BaaS built on Node.JS, Express, and MongoDB (via Monk)

Notifications You must be signed in to change notification settings

sumonst21/CloudBase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Cloudbase

##MongoDB BaaS built upon Node.js, Express, Mongo, and Socket.IO Allows one to quickly and easily add, query, remove and update items in a MongoDB
database using websockets or REST.

The code is fairly well documented with example curl usage per request and
an example client utilizing websockets is included in the clientExample directory.

###Installation:
Ensure that you have working MongoDB instance and that you have access to it.
Create a database to hold the created collections. Then:

INSTALL:

git clone https://github.com/TheInsomniac/CloudBase
npm install

EDIT: config.json.dist and rename to config.json

RUN:

npm start

###REST Usage:
Add Item:

curl -X POST -H "Content-Type: application/json" -d '{"_id":"test", "username":"me","password":"pass"}' \
http://localhost:3000/example

Get Item:

curl -X GET -H "Content-Type: application/json"  http://localhost:3000/example/test

Find Item ($regex, $lt, $gt, etc):

curl -X GET -H "Content-Type: application/json"  -d '{ "_id": { "$regex": "tes", "$options": "i" }}' \
http://localhost:3000/example

Update Item:

curl -X PUT -H "Content-Type: application/json" -d '{"username":"em","password":"ssap"}' \
http://localhost:3000/example/test

Delete Item:

curl -X DELETE -H "Content-Type: application/json" http://localhost:3000/example/test

Delete Collection:

curl -X DELETE -H "Content-Type: application/json" -d '{"clearcollection":"true"}' \
http://localhost:3000/example

Get Collection:

curl -X GET -H "Content-Type: application/json"  http://localhost:3000/example

####TODO:

  • MUCH better (rather..ADD SOME) error handling for improperly formated JSON queries..

About

MongoDB BaaS built on Node.JS, Express, and MongoDB (via Monk)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.2%
  • CSS 3.8%