Skip to content

This is a simple simple REST microservice with arguably best practices and integrations for golang.

License

Notifications You must be signed in to change notification settings

abhisheksr01/golang-microservice-best-practices

Repository files navigation

golang-microservice-best-practices

This is a simple simple REST microservice with arguably best practices and integrations for golang.

The codebase can be visualized as below:

Visualization of the codebase

Running the unit test

Execute below command from the root of this directory.

go test ./...

or

make test

Running the mutation test

Execute below command from the root of this directory.

go-mutesting --test-recursive api/...

or

make mutation-test

Start the app

Execute below command:

go run main.go

or

make start

Open the browser and make call to the url:

http://localhost:5000/greetings/greet/abhishek

You should receive a response with greeting based on the path argument passed after "/greet/" and time of the day.

Example:

Hi abhishek, Good Morning.

Running the bdd test

Make sure the app is still running, we are used godog for writing the tests.

go get github.com/cucumber/godog/cmd/godog

Execute below command from the root of this directory.

godog run

or

make bdd-test

About

This is a simple simple REST microservice with arguably best practices and integrations for golang.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published