Spaces:
Running
Running
| # RMScript Web Demo - Backend | |
| FastAPI backend for compiling and validating rmscript code. | |
| ## Installation | |
| ```bash | |
| # Install dependencies with uv | |
| uv sync | |
| ``` | |
| ## Running | |
| ```bash | |
| uv run python app.py | |
| ``` | |
| Or with uvicorn directly: | |
| ```bash | |
| uv run uvicorn app:app --reload --port 8001 | |
| ``` | |
| The API will be available at http://localhost:8001 | |
| ## API Endpoints | |
| - `GET /` - API information | |
| - `POST /api/verify` - Verify rmscript syntax (returns errors/warnings) | |
| - `POST /api/compile` - Compile rmscript to IR (returns IR actions) | |
| ## Example Usage | |
| ```bash | |
| # Verify a script | |
| curl -X POST http://localhost:8001/api/verify \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"source": "look left\nwait 1s\nlook right"}' | |
| # Compile a script | |
| curl -X POST http://localhost:8001/api/compile \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"source": "look left\nwait 1s\nlook right"}' | |
| ``` | |