openenv/coding_env
21
1# CodingEnv HTTP Server2 3This directory contains the HTTP server implementation for the CodingEnvironment.4 5## Running Locally6 7### Prerequisites8```bash9pip install fastapi uvicorn10```11 12### Start the server13```bash14# From the project root (/Users/pankit/git/envtorch)15cd src16uvicorn envs.coding_env.server.app:app --reload --host 0.0.0.0 --port 800017```18 19The server will be available at `http://localhost:8000`20 21### API Endpoints22 23- `POST /reset` - Reset the environment24- `POST /step` - Execute a code action25- `GET /state` - Get current environment state26- `GET /health` - Health check27 28### Test with curl29 30```bash31# Health check32curl http://localhost:8000/health33 34# Reset35curl -X POST http://localhost:8000/reset \36 -H "Content-Type: application/json" \37 -d '{}'38 39# Execute code40curl -X POST http://localhost:8000/step \41 -H "Content-Type: application/json" \42 -d '{43 "action": {44 "code": "print(\"Hello from HTTP!\")"45 },46 "timeout_s": 1547 }'48 49# Get state50curl http://localhost:8000/state51```52 