Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fernandospr/quick-entities
Quick-Entities is a simple implementation of services to create, read, update and delete any kind of entity.
https://github.com/fernandospr/quick-entities
Last synced: 2 months ago
JSON representation
Quick-Entities is a simple implementation of services to create, read, update and delete any kind of entity.
- Host: GitHub
- URL: https://github.com/fernandospr/quick-entities
- Owner: fernandospr
- License: mit
- Created: 2014-12-08T17:38:52.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-04-17T21:51:30.000Z (almost 7 years ago)
- Last Synced: 2024-04-16T11:03:04.050Z (9 months ago)
- Language: Ruby
- Size: 23.4 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
quick-entities
==============Quick-Entities is a simple implementation of services to create, read, update and delete any kind of entity.
It exposes REST services and saves the entities in a Mongo database.
A working example is deployed on Heroku: http://quick-entities.herokuapp.com/.
## Quick Setup
* Install Ruby, Sinatra and MongoDB.
* Run MongoDB.
* Run the application:
```
$ bundle install
$ ruby app.rb (or ruby app.rb -o 0.0.0.0 if you need to allow access from the network)
```## Usage
### Post an entity
Execute a POST request to http://localhost:4567/fruits with the following JSON body:
```
{
"id":"1",
"name": "Apple",
"color": "red"
}
```Note: if you do not provide the id, an id will be generated for you.
### Get the entities
Execute a GET request to http://localhost:4567/fruits
### Filter the entities by an attribute
Execute a GET request to http://localhost:4567/fruits?color=red
### Get one specific entity
Execute a GET request to http://localhost:4567/fruits/1
### Update an entity
Execute a PUT request to http://localhost:4567/fruits/1 with the following JSON body:
```
{
"id":"1",
"name": "Orange",
"color": "orange"
}
```### Patch an entity
Execute a PATCH request to http://localhost:4567/fruits/1 with the following JSON body:
```
{
"quantity": 10
}
```### Delete the entity
Execute a DELETE request to http://localhost:4567/fruits/1
### Get all the collections
Execute a GET request to http://localhost:4567