test-dock-fast-nginx-aio/web/main.py

17 lines
341 B
Python
Raw Normal View History

2024-08-03 22:40:56 +08:00
from os import sysenv
from fastapi import FastAPI
from pymongo import MongoClient
app = FastAPI()
client = MongoClient('mongodb+srv://admin:admin@mongo/chat')
@app.get('/api/v1/messages')
async def v1_messages():
return {'message': 'Hello World'}
@app.post('/api/v1/message')
async def v1_message():
return {'message': 'Hello World'}