this application is a simple api application using golang and mysql
- 1.5
-- note: You don't need to install the libraries one by one, because in the project there is a go mod, when the project is run for the first time it will automatically download all the libraries needed
- deploy app in docker
$~ make deploy
- view logs of running projects
$~ make logs
- remove project in docker
$~ make clear
- deploy app in docker
$~ docker-compose up -d
- url
localhost:7081
- url
localhost:8085
- user login phpmyadmin
user: root
password: pass123
- change file .env.example name to .env
- Setting database mysql in .env file
- run in terminal
$~ go run main.go
{{BASE_URL}}/user/register
- Request Body
{
"name": "andi",
"email": "andi@example.com",
"password": "123456"
}
{{BASE_URL}}/user/login
- Request Body
{
"email": "andi@example.com",
"password": "123456"
}
- Respon body
{
"success": true,
"message": "Success",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzIjoiJDJhJDEwJEQuUS9oM3FTT2dVbXFPSGNvdjdCbS5VbEdUUkl2UC52MW13WjkuTnNGVjFqN3BRLm1VdnVHIiwidXNlcl9pZCI6MX0.pjVi1Gn1ddokTsok5EQPDO8d8n60JIiZq3rB2Pl_kVI"
}
}
each account will get a different token code, you can copy the token code in the response body then enter it into the authorization section then select bearer token
{{BASE_URL}}/question
- Request Body
{
"question": "lorem ipsum dolor sit amet consectetur adipiscing elit"
}
{{BASE_URL}}/question?page=1&limit=20
{{BASE_URL}}/question/{{UUID}}
{{BASE_URL}}/question/{{UUID}}
- request body
{
"question": "INI UNTUK UPDATE 3",
"is_active": true
}
{{BASE_URL}}/question/{{UUID}}