rest-api-common

module
v0.0.0-...-4e290a4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: GPL-3.0

README

rest-api-common

Common code for building a REST API

Allows for simple CRUD microservices to be built quickly just by defining the GO struct to be stored in the database Includes: REST endpoints for implemented for this structure for CRUD operations /status and /metrics endpoints for health and observability Rate limiting middleware Validation of submitted data for the specified GO struct Logs of all status codes and errors HTTPS

Music library Example implemented in the example folder GET /api/albums GET /api/albums/:id

POST /api/albums POST /api/albums/:id DELETE /api/albums/:id

Example JSON: { "name": "Purple Rain", "artist": "Prince and The Revolution", "year": "1984", "tracks": ["Let's Go Crazy", "Take Me With U", "The Beautiful Ones", "Computer Blue", "Darling Nikki", "When Doves Cry", "I Would Die 4 U", "Baby, I'm a Star", "Purple Rain"] }

Build with: docker build -t neiln3121/music-library .

Run with Mongo using docker-compose up

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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