go-rest-server

module
v0.0.0-...-a69ed84 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT

README

Go skeleton application for REST server with additional metrics endpoint

check Go Reference Go Report License

You can run the server by typing docker-compose up --build.

Check main.go for example usage.

This project also includes the following middlewares which can be use independently of the server

  • RenderJSON - simplifies implementation of JSON REST API endpoints
  • ZapLogger - chi middleware for logging using zap logger
  • PromMetrics - chi middleware providing Prometheus metrics to your HTTP server Tracks total number of requests and requests duration partitioned by status code, method and request URI

Inside .examples directory you can find basic examples for each of the middlewares. Just run go run main.go and check the output in your browser, localhost:3000. To check the metrics in PromMetrics example, use localhost:3001.

Generate your JWT secret here

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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