Gorest is an application written in golang which serves a blog related RESTful web service.
GET
{{base_url}}/v1/blogs
List all the blogs
GET
{{base_url}}/v1/blogs/1
List a single blog
POST
{{base_url}}/v1/blogs/
Create a blog
PUT
{{base_url}}/v1/blogs/1
Update all the fields of a blog
PATCH
{{base_url}}/v1/blogs/1
Update certain fields of a blog
DELETE
{{base_url}}/v1/blogs/1
Delete a single blog
Go the terminal &
docker-compose up
or
docker-compose up -d
The latter will start the containers as a daemon
Hit the url localhost:8500
Go to Key/Value
, hit Create
, use gorest
as key
& then copy the
contents of the config.yml file from the code base and paste it as the value. Just like the
the given screenshot. Hit Save
. This will up the config.
Next, in the terminal
source run
This will both build the app & start the server. For database migrations
./gorest migration up
./gorest migration down
Run these.
Thats it. Good to go. Play with the endpoints given.
- Docker /Docker Compose
Or if you want to run everything locally
- Postgresql
- Adminer
- Consul