/env-server

This Go project, envserver-Asmaa, serves as a server that provides access to environment variables and allows users to retrieve both all the environment variables on the server and specific variables by key.

Primary LanguageGoMIT LicenseMIT

Env Server

Endpoints

  • /env returns environment variables on the server
  • /env/ returns the value of a specific env variable key

Installation

  • Clone the repository:
$ git clone https://github.com/codescalersinternships/enserver-Asmaa.git
  • Change into the project directory:
$ cd envserver-Asmaa
  • Build the project:
go build -o "bin/app" cmd/main.go
  • Run the app.
./bin/app -p [port]

How to use

  • To get all the environment variables open:
 http://localhost:8080/env
  • To get environment variable with specific "key" open:
 http://localhost:8080/env/key

How to use Docker

  • To start server using docker
docker-compose up -d

How to test

  • Run the tests by running:
go test ./...
  • If all tests pass, the output indicate that the tests have passed. if there is failure, the output will provide information about it.