Skip to content

nickhstr/go-web-service

Repository files navigation

Web Service Boilerplate

Get up and running quickly with a Go web service.


Prerequisites

Installation

git clone https://github.com/nickhstr/go-web-service.git
cd go-web-service
make

Usage

Development

For local development, create a .env file at the project's root, with the PORT variable set to whatever port you desire, otherwise it defaults to 3000. Ex: PORT=8080

To start the server:

make dev

That will not only compile and start the server, but it will recompile and restart the app on file changes.

Testing

To run all of the app's tests, and print their coverage:

make test

To run all tests, and watch for changes:

make test-watch

To open the app's test coverage report in a browser:

make coverage-html

Linting

Lint all .go files in the repo:

make lint