$ sudo docker-compose up
or
$ sudo make up
Then you can open the React frontend at localhost:3000 and the RESTful GoLang API at localhost:5000
Changing any frontend (VUE) code locally will cause a hot-reload in the browser with updates and changing any backend (GoLang) code locally will also automatically update any changes.
make connect
or
osbkone@osbkone-XPS-15-7590:~/dev/go/apigo$ docker exec -it d9f bash
root@d9f273587f3e:/# psql -U docker
docker-# \c postgres
make test
or
docker exec -it 834 bash
root@8344ae56c9b8:/go/src/apigo/back# cd tests
root@8344ae56c9b8:/go/src/apigo/back/tests# go get github.com/bxcodec/faker
root@8344ae56c9b8:/go/src/apigo/back/tests# go test -v
POST
http://localhost:5000/users
{
"email":"lolo@gmail.com",
"pass":"secret",
"first_name": "lolo",
"last_name": "canava",
"birth_date": "0001-01-01T00:00:00Z"
}
POST
http://localhost:5000/login
{
"email":"lolo@gmail.com",
"pass":"secret"
}
PUT
http://localhost:5000/users/:uuid
{
"email":"lolo@gmail.com",
"pass":"secret",
"first_name": "lolo",
"last_name": "canava"
}
DELETE
http://localhost:5000/users/:uuid
{
}
GET
http://localhost:5000/votes
{
}
GET
http://localhost:5000/votes/:uuid
{
}
POST
http://localhost:5000/votes
{
"title":"brexit"
"description":"Vote du brexit"
}
PUT
http://localhost:5000/votes/:uuid
{
"title":"brexit 2"
"description":"Vote du brexit 2"
}
DELETE
http://localhost:5000/votes/:uuid
{
}
POST
http://localhost:5000/votes/:uuid
{
}