fix: update UI server startup message to reflect dynamic frontend port
This commit is contained in:
parent
c0d2abdf5e
commit
0fac104fc7
2 changed files with 5 additions and 14 deletions
|
|
@ -42,23 +42,14 @@ mcp = FastMCP("Cognee")
|
|||
logger = get_logger()
|
||||
|
||||
|
||||
cors_middleware = Middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
async def run_sse_with_cors():
|
||||
"""Custom SSE transport with CORS middleware."""
|
||||
sse_app = mcp.sse_app()
|
||||
sse_app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_origins=["http://localhost:3000"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
||||
allow_methods=["GET"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
|
@ -77,9 +68,9 @@ async def run_http_with_cors():
|
|||
http_app = mcp.streamable_http_app()
|
||||
http_app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_origins=["http://localhost:3000"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
||||
allow_methods=["GET"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ def main() -> int:
|
|||
|
||||
if server_process:
|
||||
fmt.success("UI server started successfully!")
|
||||
fmt.echo("The interface is available at: http://localhost:3000")
|
||||
fmt.echo(f"The interface is available at: http://localhost:{frontend_port}")
|
||||
if start_backend:
|
||||
fmt.echo(f"The API backend is available at: http://localhost:{backend_port}")
|
||||
if start_mcp:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue