fibAPI

command module
v0.0.0-...-a81adf3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 12 Imported by: 0

README

The Fibonacci API

This API exposes three endpoints that can be called via HTTP requests:

  • /current - returns the current number in the sequence
  • /next - returns the next number in the sequence
  • /previous - returns the previous number in the sequence

How it Works

go get -u github.com/smith4040/fibAPI

Run the fibAPI in the terminal or build and run with Docker.

Using Postman or your favorite API testing tool, send "GET" request to "http://localhost:8080/current", "http://localhost:8080/next" or "http://localhost:8080/previous".

About the API - Why choose...

gin-gonic/gin web framework was chosen due to its great performance, able to handle high throughput and minimalistic design. I went with the gin.Default implementation which handles the logging and recovery from panic.

stretchr/testify testing package was chosen to aid in testing the handlers with the assert function.

t-pwk/go-fibonacci package contains a benchmarked and tested Fibonacci function that is ideal for this project.

fvbock/endles router handles unexpected crashes of the router and automatically restarts.

A Dockerfile has been add to quickly run this application in a Docker container.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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