File size: 879 Bytes
65da30d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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"}'
```