backend: initi backend

This commit is contained in:
tylen
2025-09-09 00:37:15 +03:00
parent fb26267244
commit 9a330f3743
7 changed files with 121 additions and 0 deletions

24
backend/src/server.py Normal file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python
# encoding: utf-8
'''
server.py is the main source file for the Dungeon's backend service.
'''
from flask import Flask, request, jsonify
from dotenv import load_dotenv
from db_client import DBClient
load_dotenv()
app = Flask(__name__)
database = DBClient()
@app.route('/login', methods=['POST'])
def login():
if request.is_json:
return request.json, 200
else:
return jsonify({'error': 'Request must contain JSON data'}), 400
if __name__ == "__main__":
app.run(debug=True)