Skip to content

fernandospr/quick-entities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

$ 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

About

Quick-Entities is a simple implementation of services to create, read, update and delete any kind of entity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages