example-rest-api

module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2024 License: MIT

README

example-rest-api

A sample REST API project in Go designed for managing books. This project serves as a concrete example of a fully functional REST API without relying on complex frameworks.

motivation

The motivation behind creating example-rest-api was to offer more than just a basic "hello world" example. I aimed to provide a fully functional REST API template, almost production-ready, to demonstrate real-world applications. This project addresses the gap often found in simplistic examples, offering a comprehensive and practical guide for developers looking to understand and implement a REST API in Go without overly complex frameworks.

key features

running it

make run PORT=<port>

running tests

make test

coverage report

make coverage

api documentation

Two files hold api's documentation: doc.go and api.go.

To re-generate doc/swagger.json,

make swagger

To view it on a browser,

make swaggger-ui

then visit localhost.

available Makefile targets

To generate the basic Makefile I've used go-makefile-gen, a tool that I've written.

Directories

Path Synopsis
db
Books Rest API
Books Rest API
v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL