Spaces:
Sleeping
Sleeping
from fastapi import FastAPI, Request | |
from fastapi.middleware.cors import CORSMiddleware | |
from executor.workflow import execute | |
import pyrebase | |
app = FastAPI() | |
# Enable CORS for all origins | |
app.add_middleware( | |
CORSMiddleware, | |
allow_origins=["*"], | |
allow_credentials=True, | |
allow_methods=["*"], | |
allow_headers=["*"], | |
) | |
async def index(): | |
return {"message": "Welcome to the Flowify Workflow Executor API"} | |
async def execute_workflow(request: Request): | |
workflow = await request.json() | |
print(workflow) | |
data = execute(workflow) | |
return data | |