This repository is creates a simple server, implemented in GoLang, that runs in a docker container
- Clone the repository
git clone https://github.com/b6luong/SimpleServer.git - Go to the repo directory
cd SimpleServer - Set the environment
source ./envrc - Build the executable
make server - Start the server
./build/myserver - Verify the server. You should expect
<h1>Welcome to the SimpleServer!</h1>response
curl http://localhost:8080 - Verify the server. You should expect
<h1>Hello world! I am a server created by Ben.</h1>response
curl http://localhost:8080/hello/
Ensure that you are able to run locally from the instructions above.
- Go to the repo directory
cd SimpleServer - Build docker image
make docker - Start the server as a docker image
docker run -p 5000:8080 simple-server - Verify the server. You should expect
<h1>Welcome to the SimpleServer!</h1>response
curl http://localhost:8080 - Verify the server. You should expect
<h1>Hello world! I am a server created by Ben.</h1>response
curl http://localhost:8080/hello/