Giter VIP home page Giter VIP logo

cloudbase's Introduction

#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..

cloudbase's People

Contributors

theinsomniac avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.