This commit is contained in:
Patrick_Pluto 2024-09-20 11:15:42 +02:00
parent 1ee7d55e49
commit 4a183c0c89
2 changed files with 50 additions and 0 deletions

View file

@ -2,6 +2,7 @@ from flask import Flask, request, jsonify
from flask_cors import CORS
import secrets
from ai import AI
from db import DB
class API:
@ -9,6 +10,7 @@ class API:
self.app = Flask(__name__)
self.ai_response = {}
self.ai = AI()
self.db = DB()
CORS(self.app)
def run(self):
@ -36,6 +38,13 @@ class API:
return jsonify({'status': 401, 'error': 'Invalid access token'})
return jsonify({'status': 200, 'response': self.ai_response[data]})
@self.app.route('/interstellar/api/db', methods=['POST'])
def db_manipulate():
action = request.args.get('action')
if action == "create_account":
print("ahh")
ssl_context = ('cert.pem', 'key.pem')
self.app.run(debug=True, host='0.0.0.0', port=5000, ssl_context=ssl_context)