From 8c0de92c437bc9de25babebecf23b81845856bb6 Mon Sep 17 00:00:00 2001 From: Maxime Delporte Date: Fri, 10 Oct 2025 11:13:06 +0200 Subject: [PATCH] Updating README with API initialisation and tips. --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index e69de29..0e442aa 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,26 @@ +# Installation + +## Launch API +`go run ./cmd/api` + +If you want, you can also verify that the command-line flags are working correctly by specifying alternative **port** and **env** values when starting the application. +When you do this, you should see the contents of the log message change accordingly. For example : + +`go run ./cmd/api -port=3030 -env=production` +**time=2025-10-10T11:08:00.000+02:00 level=INFO msg= +"starting server" addr=:3030 env=production** + +## Test endpoints +`curl -i localhost:4000/v1/healthcheck` +The *-i* flag in the command above instructs curl to display the HTTP response headers as well as the response body. + +### Result + +HTTP/1.1 200 OK +Date: Mon, 05 Apr 2021 17:46:14 GMT +Content-Length: 58 +Content-Type: text/plain; charset=utf-8 + +status: available +environment: development +version: 1.0.0