pytrace/server/app/main.py

21 lines
623 B
Python
Raw Normal View History

2026-01-15 21:58:30 +08:00
from fastapi import FastAPI
from .nodes import register_builtin_nodes
from .api import endpoints_graph, endpoints_custom_nodes
app = FastAPI(
title="TraceStudio Server",
description="The backend server for the TraceStudio workflow engine.",
version="2.0.0",
)
@app.on_event("startup")
async def startup_event():
register_builtin_nodes()
app.include_router(endpoints_graph.router, prefix="/graph", tags=["Graph"])
app.include_router(endpoints_custom_nodes.router, prefix="/custom-nodes", tags=["Custom Nodes"])
@app.get("/")
async def read_root():
return {"message": "Welcome to TraceStudio Server"}