Spaces:
Running
Running
RMScript Web Demo - Backend
FastAPI backend for compiling and validating rmscript code.
Installation
# Install dependencies with uv
uv sync
Running
uv run python app.py
Or with uvicorn directly:
uv run uvicorn app:app --reload --port 8001
The API will be available at http://localhost:8001
API Endpoints
GET /- API informationPOST /api/verify- Verify rmscript syntax (returns errors/warnings)POST /api/compile- Compile rmscript to IR (returns IR actions)
Example Usage
# 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"}'