- Go 1.21
- Postgresql 12
git clone git@github.com:juliocesar014/auth-api-user.git
cd auth-api-user
docker build -t auth-api-user .
docker run -p 8000:8000 auth-api-user
- [GET all users] localhost:8000/users
curl http://localhost:8000/users
- [POST user] localhost:8000/users
curl -X POST -H "Content-Type: application/json" -d '{
"name": "first name",
"email": "name@example.com",
"password": "example#123"
}' http://localhost:8000/users
- [GET users by id] localhost:8000/users/{id}
curl http://localhost:8000/users/1
- [PUT user] localhost:8000/users/{id}
curl -X PUT -H "Content-Type: application/json" -d '{
"name": "new name",
"email": "newemail@example.com",
"password": "newpassword#123"
}' http://localhost:8000/users/1
- [DELETE user] localhost:8000/users/{id}
curl -X DELETE http://localhost:8000/users/1
- [POST login] localhost:8000/login This route is used for user authentication. The client must provide a JSON object containing a valid email and password. If the credentials are correct, the route returns a JWT access token, which can be used to authenticate and authorize the user in other parts of the application.
curl -X POST -H "Content-Type: application/json" -d '{
"email": "name@example.com",
"password": "example#123"
}' http://localhost:8000/login
- [GET health status api] localhost:8000/health
curl http://localhost:8000/health
- [GET all users] https://auth-api-user.onrender.com/users
curl http://https://auth-api-user.onrender.com/users
- [POST user] https://auth-api-user.onrender.com/users
curl -X POST -H "Content-Type: application/json" -d '{
"name": "first name",
"email": "name@example.com",
"password": "example#123"
}' http://https://auth-api-user.onrender.com/users
- [GET users by id] https://auth-api-user.onrender.com/users/{id}
curl http://https://auth-api-user.onrender.com/users/1
- [PUT user] https://auth-api-user.onrender.com/users/{id}
curl -X PUT -H "Content-Type: application/json" -d '{
"name": "new name",
"email": "newemail@example.com",
"password": "newpassword#123"
}' http://https://auth-api-user.onrender.com/users/1
- [DELETE user] https://auth-api-user.onrender.com/users/{id}
curl -X DELETE http://https://auth-api-user.onrender.com/users/1
- [POST login] https://auth-api-user.onrender.com/login This route is used for user authentication. The client must provide a JSON object containing a valid email and password. If the credentials are correct, the route returns a JWT access token, which can be used to authenticate and authorize the user in other parts of the application.
curl -X POST -H "Content-Type: application/json" -d '{
"email": "name@example.com",
"password": "example#123"
}' http://https://auth-api-user.onrender.com/login
- [GET health status api] https://auth-api-user.onrender.com/health
curl http://https://auth-api-user.onrender.com/health