Skip to content

diogomascarenha/rocketseat-bootcamp-6-go-node-app-marketplace

Repository files navigation

Bootcamp Project 6 - Rocketseat - GoNode - App Marketplace

Install Application

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

APIs

Create User

curl -X POST \
  http://localhost:3000/users \
  -H 'Content-Type: application/json' \
  -d '{
	"name":"User Test",
	"email":"sample@example.com",
	"password":"123456"
}'

Create Session

curl -X POST \
  http://localhost:3000/sessions \
  -H 'Content-Type: application/json' \
  -d '{
	"email":"sample@example.com",
	"password":"123456"
}'

Create Ad

  • 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
}'

Create Purchase

  • 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"
}'

About

Projeto do Bootcamp 6 da Rocketseat - GoNode - App Marketplace

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published