mirror of
https://gitlab.sectorq.eu/jaydee/api_server.git
synced 2026-09-17 02:12:55 +02:00
Initial commit
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
from fastapi import FastAPI, Depends
|
||||
from app.auth import verify_token
|
||||
from app.scripts import script1, script2
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/")
|
||||
def root():
|
||||
return {"status": "API running"}
|
||||
|
||||
@app.post("/script1")
|
||||
def run_script1(auth=Depends(verify_token)):
|
||||
result = script1.run()
|
||||
return {"result": result}
|
||||
|
||||
@app.post("/script2")
|
||||
def run_script2(auth=Depends(verify_token)):
|
||||
result = script2.run()
|
||||
return {"result": result}
|
||||
Reference in New Issue
Block a user