Skip to content

razvanbalota/go-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-api

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.

Endpoints

GET /account/coins/?username=<username>

Responses:

Success:

{
  "Code": 200,
  "Balance": <int64>
}

400 Error:

{
  "Code": 400,
  "Message": "Invalid username or token"
}

500 Error:

{
  "Code": 500,
  "Message": "An Unexpected Error Occurred."
}

Usage

  • Clone the repository.

  • Start the server:

go run cmd/api/main.go
  • Test the API using Postman or Thunder Client.

About

A simple Go API service for retrieving a user’s coin balance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages