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

17 lines
341 B
Python

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'}