PHP Classes

File: apppython/main.py

Recommend this page to a friend!
  Classes of Rodrigo Faustino   Chat SSE   apppython/main.py   Download  
File: apppython/main.py
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Chat SSE
Exchange chat messages using server-sent events
Author: By
Last change:
Date: 7 months ago
Size: 491 bytes
 

Contents

Class file image Download
from fastapi import FastAPI from database.config import ORIGINS from fastapi.middleware.cors import CORSMiddleware from routes.message_routes import router as message_router app = FastAPI() app.add_middleware( CORSMiddleware, allow_origins=ORIGINS, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) app.include_router(message_router) if __name__ == "__main__": import uvicorn uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)