Neon-AI commited on
Commit
7525023
·
verified ·
1 Parent(s): cc567f8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ import subprocess
3
+
4
+ app = FastAPI()
5
+
6
+ @app.post("/run")
7
+ def run(payload: dict):
8
+ result = subprocess.run(
9
+ ["bash", "-c", payload["bash"]],
10
+ capture_output=True, text=True, timeout=30
11
+ )
12
+ return {"output": result.stdout + result.stderr}