ts-quiz— ~/loading.ts
tsc --watch● loading…
// tsc --watch · type-checking modules…
await load("loading.ts")
// streaming server components
◇ tsc 6.0.3 · compiling…UTF-8◇ loading…
from fastapi import FastAPI, WebSocket
app = FastAPI()
@app.websocket('/ws')
async def ws(websocket: WebSocket):
await websocket.accept()
msg = await websocket.receive_text()
await websocket.send_text(f'echo:{msg}')