Skip to content

Tiny HTTP server showing the environment variables

Notifications You must be signed in to change notification settings

mighty-muffin/httpenv-app

httpenv-app

A tiny HTTP server built with FastAPI, demonstrating usage of environment variables and modern Python packaging with UV.

Features

  • Simple HTTP API with endpoints:
    • / — returns a greeting
    • /bye — returns a farewell
    • /external — returns a project external api
    • /healthcheck — returns application healthcheck
    • /??? — returns a secret (chuuu don't tell anyone)

Requirements

Getting Started

There is a Makefile for your convenience and usage.

1. Install UV

Follow instructions from the UV Docs or use:

curl -Ls https://astral.sh/uv/install.sh | sh
uv self version # uv 0.8.13

2. Setup python & install dependencies

Run the following command in the project directory:

uv venv --python 3.13
uv sync
uv run pytest # If you want to run the tests

3. Run the server

Start the FastAPI server using Uvicorn:

uv run uvicorn app.main:app --port 8080 # Go to http://localhost:8080

4. Build a container

To build this container run these commands:

docker buildx build -f Dockerfile . -t httpenv-app
docker run -d httpenv-app:latest

Dev Tools

1. Install dev dependencies

Follow instructions from the gghshield docs or use:

pipx install ggshield # if you are old school using .venv
pipx install ggshield # if you are using os-level python isolation env
uv tool install ggshield # if you use UV.. you should be using UV

2. Login to GG

Follow instructions from the gghshield docs or use:

ggshield auth login
ggshield api-status
ggshield quota

Environment Variables

Rename .sample.env to .env file in the project root and include a secret var here:

SECRET ="<your-token-here>"

About

Tiny HTTP server showing the environment variables

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors