For a quick, clean, and easy backend.
Restroom lets you spin up fully RESTful HTTP servers with a single command, for use in prototyping, demos, and hackathons. It provides support for all standard CRUD operations on multiple collections, as well as associations between items.
var Restroom = ;var collections = "leviathans" "encyclopaedias" "grandmothers";
With optional configuration
var Restroom = ;
All methods accept and return bodies in JSON form.
Returns all items in the given collection as an array.
Creates an item with the data in the request body and adds it to the given collection in storage. If you provide an id field, it must not match any existing documents in the collection. If no id field is provided, one will be generated automatically.
Returns the item in the given collection with the given id.
Sets the data of the item in the given collection with the given id to the request body. Returns the created item. If an id field is given in the request body, it will be ignored (to prevent ids from changing).
Merges the data of the item in the given collection with the given id with the request body. If an id field is given in the request body, it will be ignored (to prevent ids from changing).
Deletes the item with the given id in the given collection. This will clear all associations involving that item.
Returns all items of type collection2 associated with the item in collection1 with the id1. Note that collection1 and collection2 may be the same - for example, associating a user with another user can represent a friendship.
Associates the item with id1 in collection1 with the item with id2 in collection2.
Removes all associations between the item in collection1 with id1 and items in collection2
Removes the association between the item with id1 in collection1 with the item with id2 in collection2.
The callback to your server returns a
models object with a variety of methods to manipulate the data in storage. You may want to use them if you want, for example, a specific fixture scenario to load each time you restart your app. See the test suite for documentation.