slimshadow commited on
Commit
2d43f07
·
verified ·
1 Parent(s): 2221b11

Delete app

Browse files
Files changed (2) hide show
  1. app/main.py +0 -30
  2. app/requirements.txt +0 -2
app/main.py DELETED
@@ -1,30 +0,0 @@
1
- from fastapi import FastAPI, WebSocket
2
- from fastapi.middleware.cors import CORSMiddleware
3
-
4
- app = FastAPI()
5
-
6
- # Allow CORS for local development
7
- app.add_middleware(
8
- CORSMiddleware,
9
- allow_origins=["*"],
10
- allow_credentials=True,
11
- allow_methods=["*"],
12
- allow_headers=["*"],
13
- )
14
-
15
- connected_clients = []
16
-
17
- @app.websocket("/ws")
18
- async def websocket_endpoint(websocket: WebSocket):
19
- await websocket.accept()
20
- connected_clients.append(websocket)
21
- try:
22
- while True:
23
- data = await websocket.receive_text()
24
- for client in connected_clients:
25
- if client != websocket:
26
- await client.send_text(data)
27
- except Exception as e:
28
- print(f"Client disconnected: {e}")
29
- finally:
30
- connected_clients.remove(websocket)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/requirements.txt DELETED
@@ -1,2 +0,0 @@
1
- fastapi
2
- uvicorn