A simple Go API service that provides a mock database for retrieving a user’s coin balance. This service returns JSON responses, including success and error handling.
GET /account/coins/?username=<username>{
"Code": 200,
"Balance": <int64>
}{
"Code": 400,
"Message": "Invalid username or token"
}{
"Code": 500,
"Message": "An Unexpected Error Occurred."
}-
Clone the repository.
-
Start the server:
go run cmd/api/main.go- Test the API using Postman or Thunder Client.