This repository contains two simple HTTP server implementations in Python:
- FastAPI server (
fastapi_server/fastapi_app.py) - Built-in HTTPServer server (
http_server/simple_http_server.py)
- Python 3.7+
- For FastAPI server:
fastapianduvicornpackages
You can install the FastAPI dependencies with:
pip install fastapi uvicornRun the FastAPI server using Uvicorn:
python -m uvicorn fastapi_server.fastapi_app:app --host 127.0.0.1 --port 4000 --reload- The server will be accessible at:
http://localhost:4000 - Use
/set?key=valueand/get?key=your_keyendpoints.
Run the simple HTTPServer-based server:
python http_server/simple_http_server.py- The server listens on port 4000 by default.
- Use
/set?key=valueand/get?key=your_keyendpoints similarly.
- Both servers store key-value pairs in memory and will lose data on restart.
- The FastAPI server supports automatic reload on code changes.
- The built-in HTTPServer server has no external dependencies.