Environment Variable Service

A simple FastAPI application that returns the value of environment variables, specifically designed to return the value of the NAME environment variable.

Features

  • Get the value of the NAME environment variable
  • Get the value of any environment variable by name
  • Health check endpoint to verify service status

Installation

  1. Clone the repository:
git clone <repository-url>
cd environmentvariableservice
  1. Install dependencies:
pip install -r requirements.txt

Usage

  1. Set environment variables (optional):
export NAME="Your Name"
  1. Run the application:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
  1. Access the API:

API Endpoints

Get NAME environment variable

GET /env/name

Returns the value of the NAME environment variable.

Get any environment variable

GET /env/{variable_name}

Returns the value of the specified environment variable.

Health Check

GET /health

Returns the status of the service.

Development

  • The application uses FastAPI for the REST API
  • Environment variables are accessed via the Python os module
  • Ruff is used for linting and code formatting
Description
Project: Environment Variable Service
Readme 32 KiB
Languages
Python 100%