hotcoffee
Version:
Brew you some hot micro servers
74 lines (50 loc) • 1.9 kB
Markdown
hotcoffee
==============================
[](https://travis-ci.org/kr1sp1n/hotcoffee)
[](https://coveralls.io/r/kr1sp1n/hotcoffee)
[](https://www.npmjs.com/package/hotcoffee)
[](https://david-dm.org/kr1sp1n/hotcoffee)
[](https://flattr.com/submit/auto?user_id=krispin&url=https://github.com/kr1sp1n/hotcoffee&title=hotcoffee&language=coffeescript&tags=github&category=software)
REST API that saves everything you can imagine.
You just think about a collection name and add an item to it by sending a POST request with body data.
Then you can manipulate items of a collection.
You need [Node.js](https://nodejs.org/) to run the server locally.
You can install it via [nvm](https://github.com/creationix/nvm).
Install
-----------------------------
```bash
git clone git://github.com/kr1sp1n/hotcoffee.git
cd hotcoffee
make install
```
Run Tests
-----------------------------
```bash
make test
```
Start the example server
-----------------------------
```bash
./node_modules/.bin/coffee example/simple_server.coffee
```
Usage
-----------------------------
### GET a list of all collections
```bash
curl http://localhost:1337/
```
__Response__ would be an empty JSON array as long as you never added an item to any collection.
```JSON
[]
```
### POST a new item to a collection
```bash
curl -X POST -d "name=Donatello&color=purple" http://localhost:1337/turtles
```
__Response__
```JSON
{
"name": "Donatello",
"color": "purple"
}
```