Download master branch
git clone https://github.com/diogomascarenha/rocketseat-bootcamp-6-go-node-app-marketplace.git app-marketpace
cd app-marketpace
Make a copy .env.example and rename to .env
cp .env.example .env
Configure .env file
Install dependencies
docker-compose run app yarn
Start docker-compose
docker-compose up -d
(OPTIONAL) Fetch the logs of containers
docker-compose logs -f
(OPTIONAL) Open Mailhog
Open Browser http://localhost:8025
curl -X POST \
http://localhost:3000/users \
-H 'Content-Type: application/json' \
-d '{
"name":"User Test",
"email":"sample@example.com",
"password":"123456"
}'
curl -X POST \
http://localhost:3000/sessions \
-H 'Content-Type: application/json' \
-d '{
"email":"sample@example.com",
"password":"123456"
}'
- replace SESSION_TOKEN_HERE
curl -X POST \
http://localhost:3000/ads \
-H 'Authorization: Bearer SESSION_TOKEN_HERE' \
-H 'Content-Type: application/json' \
-d '{
"title":"Sample Title",
"description":"Sample Description",
"price":123.45
}'
- replace SESSION_TOKEN_HERE and AD_ID_HERE
curl -X POST \
http://localhost:3000/purchases \
-H 'Authorization: Bearer SESSION_TOKEN_HERE' \
-H 'Content-Type: application/json' \
-d '{
"ad":"AD_ID_HERE",
"content":"Test Mail Message"
}'