Skip to content

Files

Latest commit

39371c6 · Jan 22, 2018

History

History

go-simple-server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jan 22, 2018
Jan 22, 2018
Jan 22, 2018
Jan 22, 2018

README.md

go-simple-server

A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies. This microservice is based on a GitHub gist by enricofoltran, featured on HackerNews which was later moved to enricofoltran/simple-go-server.

Local development

With Docker

# go to app directory
$ cd microservices/app

# build the docker image
$ docker build -t simple-go-server-app .

# run the image
$ docker run --rm -it -p 5000:5000 simple-go-server-app

# app will be available at http://localhost:5000
# press Ctrl+C to stop the server

Without Docker

  • Install Golang
  • Move the simple-go-server directory to your GOPATH and cd into the directory
# change to app directory
$ cd mircoservices/app

# run the local server script
# windows users: run this in git bash
$ go run src/main.go

# app will be available at http://localhost:5000
# press Ctrl+C to stop the server