This project is a personal learning exercise to build a simple REST API using Go and Next.js. The goal is to practice building APIs with the following tools and libraries:
- go-chi/chi: A lightweight, idiomatic HTTP router for Go.
- rs/zerolog: A high-performance, structured logging library.
- stretchr/testify: A testing toolkit for Go with a variety of helpers for assertions and mocking.
git clone https://github.com/mmadariaga/go-api.git
cd go-api
docker-compose up
Currently, the API only has two routes:
GET /ping
: Returns a simple "pong" response.GET /races/{year}
: Returns application_races.RacesByYearResponse json object with a summary of all the races of the year 2024 in f1. This endpoint requires Basic Auth (go:api)GET /races/drivers
: Returns domain_model.Driver json object array with the drivers that participated in the last race. This endpoint requires Basic Auth (go:api)
Example:
$ curl http://localhost:8080/ping
pong
- Create a web interface with next.js and tailwind
This project is licensed under the MIT License - see the LICENSE file for details.