Skip to content

mmadariaga/go-f1-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go REST API - Learning Project

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.

Install & Run

git clone https://github.com/mmadariaga/go-api.git
cd go-api/api
# install dependencies
go mod tidy 
# Run tests
bin/test
# Run the server
bin/run

Features

Currently, the API only has two routes:

  • GET /ping: Returns a simple "pong" response.
  • GET /races/{year}: Returns application_races.Response json object with a summary of all the races of the year 2024 in f1. This endpoint requires Basic Auth (go:api)

Example:

$ curl http://localhost:8080/ping
pong

TODO

  • Create a web interface with next.js and tailwind

Licence

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published