harbor run -t openthoughts/tasktrove-exp-rpt-stack-dockerfile-v2-stack-dockerfile-0313harbor download openthoughts/tasktrove-exp-rpt-stack-dockerfile-v2-stack-dockerfile-0313Task: Build a small Python HTTP API (standard library only)
Overview Create a self-contained Python application that runs an HTTP server using only the Python standard library. The server should expose a few lightweight endpoints to demonstrate basic API behavior, including query parameters, JSON handling, and a simple in-memory data store. The solution must be placed in the /app/ directory inside the container.
Deliverables (placed under /app/)
What to implement
Server implementation
Endpoints and behavior
How the solution will be evaluated
Example interactions (expected results)
curl http://localhost:8000/health
curl http://localhost:8000/time
curl "http://localhost:8000/city?name=London"
curl "http://localhost:8000/city?name=UnknownCity"
curl -X POST -H "Content-Type: application/json" -d '{"message":"hello"}' http://localhost:8000/echo
curl -X POST -H "Content-Type: application/json" -d 'invalid' http://localhost:8000/echo
Constraints and guidelines
Optional enhancements (not required)