Skip to content

entropy is a simple RESTful server in front of a MongoDB instance using node.js, Express, Connect and Mongoose.

License

Notifications You must be signed in to change notification settings

coreagame/entropy.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

entropy is a simple RESTful server in front of a MongoDB instance using node.js, Express, Connect and Mongoose.

DEPENDENCIES

INSTALLATION

Clone the Github repository or simply download the sources. You can run an entropy instance just by starting it with the node command:

node entropy.js

CONFIGURATION

Copy the config.json.sample file to config.json and modify it to fit your needs.

USAGE

You can put your Mongoose models in the /models directory. Here's an example of an simple user model:

// models/user.js
var mongoose = require("mongoose").Mongoose;

mongoose.model("user", {
  properties: ["username", "email"],
  cast: {
    username: String,
    email: String
  },
  indexes: ["username", "email"]
});

That's it. You can now find, read, create, modify and remove user objects via REST, just by calling the appropriate URLs:

GET localhost:3000/user // find
GET localhost:3000/user/1 // read
POST localhost:3000/user?user[username]=foo&user[email]=bar // create
POST localhost:3000/user/1?user[username]=foo&user[email]=bar // modify
DELETE localhost:3000/user/1 // remove

LICENSE

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

About

entropy is a simple RESTful server in front of a MongoDB instance using node.js, Express, Connect and Mongoose.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published