Make base web

This commit is contained in:
BitHeaven 2024-08-03 17:40:56 +03:00
parent b3b11d2d01
commit 7787cc5b69
1 changed files with 16 additions and 0 deletions

16
web/main.py Normal file
View File

@ -0,0 +1,16 @@
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'}