diff --git a/api_sender.html b/api_sender.html
index e8cb9ad..a061ce8 100644
--- a/api_sender.html
+++ b/api_sender.html
@@ -100,7 +100,7 @@ document.addEventListener('DOMContentLoaded', () => {
});
function sendRequest(endpoint, payload) {
- return fetch(`http://192.168.1.94:3000/${endpoint}`, {
+ return fetch(`http://api.servii.fr:3000/${endpoint}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
diff --git a/app.py b/app.py
index 730f5b2..7d696a6 100644
--- a/app.py
+++ b/app.py
@@ -1,7 +1,7 @@
import http
import inspect
-from flask import Flask, Response, jsonify, request
+from flask import Blueprint, Flask, Response, jsonify, request
from flask_cors import CORS
import firebase_manager
@@ -10,6 +10,7 @@ import generic_executor
app = Flask(__name__)
CORS(app)
cors = CORS(app, origins=['*'])
+apiBP = Blueprint('api', 'api', subdomain="api")
def generic_response_maker(status_code: http.HTTPStatus, _message: str = None) -> tuple[Response, int]:
@@ -90,7 +91,7 @@ route_handlers = {
}
-@app.route('/', methods=['POST'])
+@apiBP.route('/', methods=['POST'])
def dynamic_route_handler(path):
if path not in route_handlers:
return generic_response_maker(http.HTTPStatus.METHOD_NOT_ALLOWED)
@@ -114,4 +115,5 @@ def dynamic_route_handler(path):
if __name__ == '__main__':
ssl_context = ('/fullchain.pem', '/privkey.pem')
+ app.register_blueprint(apiBP)
app.run(host='0.0.0.0', port=3000, debug=False)