SoUmNerd commited on
Commit
08b90ab
1 Parent(s): 372b1d3

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -5
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
- data = await request.json()
14
- print(data)
15
- print(type(data))
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