23 lines
487 B
Python
23 lines
487 B
Python
from fastapi import FastAPI, WebSocket
|
|
|
|
from app.core.config import get_settings
|
|
|
|
settings = get_settings()
|
|
|
|
app = FastAPI(
|
|
title="University Process Hub",
|
|
root_path=settings.APP_PREFIX,
|
|
)
|
|
|
|
|
|
@app.get("/")
|
|
async def root():
|
|
return {"status": "ok", "env": settings.APP_ENV}
|
|
|
|
|
|
@app.websocket("/ws/hello/{name}")
|
|
async def websocket_hello(websocket: WebSocket, name: str):
|
|
await websocket.accept()
|
|
await websocket.send_text(f"Hello, {name}!")
|
|
await websocket.close()
|