Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from fastapi import FastAPI, Request
|
2 |
|
3 |
-
import subprocess
|
4 |
from regex import find_imports
|
5 |
|
6 |
|
@@ -10,10 +10,10 @@ app = FastAPI()
|
|
10 |
|
11 |
@app.post("/code")
|
12 |
async def run_mojo_code(request:Request) -> dict:
|
13 |
-
|
14 |
-
print(
|
15 |
-
print(type(
|
16 |
-
|
17 |
code = data["code"]
|
18 |
filename = data["filename"]
|
19 |
|
|
|
1 |
from fastapi import FastAPI, Request
|
2 |
|
3 |
+
import subprocess, json
|
4 |
from regex import find_imports
|
5 |
|
6 |
|
|
|
10 |
|
11 |
@app.post("/code")
|
12 |
async def run_mojo_code(request:Request) -> dict:
|
13 |
+
data_as_str = await request.json()
|
14 |
+
print(data_as_str)
|
15 |
+
print(type(data_as_str))
|
16 |
+
data = json.loads(data_as_str)
|
17 |
code = data["code"]
|
18 |
filename = data["filename"]
|
19 |
|