- 新增 README_CN.md 中文文档 - 新增 frontend/ Vue 3 前端项目 - 新增 web/ FastAPI 后端项目 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
822 B
Python
34 lines
822 B
Python
"""FastAPI application entry point for BtToxin Pipeline Web Backend.
|
|
|
|
Requirements: 7.5
|
|
"""
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from .config import settings
|
|
|
|
# Create FastAPI application
|
|
app = FastAPI(
|
|
title="BtToxin Pipeline Web API",
|
|
description="Web API for BtToxin Pipeline - analyze genome files for insecticidal proteins",
|
|
version="0.1.0",
|
|
docs_url="/api/docs" if settings.debug else None,
|
|
redoc_url="/api/redoc" if settings.debug else None,
|
|
)
|
|
|
|
# Configure CORS
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.cors_origins,
|
|
allow_credentials=True,
|
|
allow_methods=["GET", "POST"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
@app.get("/api/health")
|
|
async def health_check():
|
|
"""Health check endpoint."""
|
|
return {"status": "healthy"}
|