Skip to content

LukeSynatic/syn-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

syn-api

##About

A demo project for the purposes of benchmarking a Golang web CRUD API, with a backing MongoDB database.

##Running the application

###Database There is a simple docker-compose configuration included in the project that will run a MongoDB container to serve as a local test database.

Open a terminal and run docker-compose up to run the container.

###Server Running the server with hot-reloading requires an external tool called CompileDaemon to watch for files changes. You can download and install CompileDaemon globally by first running go get github.com/githubnemo/CompileDaemon, followed by go install github.com/githubnemo/CompileDaemon. Once you have CompileDaemon installed, run CompileDaemon -command="./syn-api" to run the compiled executable of the application.

To run the server without hot-reloading, run go run ..

##Web Framework

###Fiber

Fiber is a simple, fast and versatile web framework, inspired by Express.js. It is built on top of another Go module called fasthttp, which was designed to provide more performance than Go's built in net/http module.

This gives Fiber a performance edge over other frameworks in it's class (especially when you enable it's Prefork mode), while it still maintains a focus on simplicity and ease-of-use.

It offers some great features:

  • Out-of-the-box concurrency utilizing Go's built in concurrency superpowers

  • Minimal allocation of memory resources thanks to a focus on immutability, allowing route handlers to share and re-use common resources

  • Some pre-packaged middleware, including logging, rate limiting, sessions, and a version of the popular Node-based middleware, Helmet

##Dependencies

###mongo-driver The standard MongoDB driver for Go. Documentation is available here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages