23 lines
412 B
Python
23 lines
412 B
Python
from dotenv import load_dotenv
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from router import router
|
|
|
|
# 初始化FastAPI
|
|
app = FastAPI(
|
|
title="Sweet Hut Agent",
|
|
description="智能体",
|
|
version="0.1.0"
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
load_dotenv()
|
|
|
|
app.include_router(router)
|