[~] Latest push

Signed-off-by: Charles Le Maux <charles.le-maux@epitech.eu>
This commit is contained in:
Charles Le Maux 2024-06-29 21:40:26 +01:00
parent 0f0ef0ec95
commit ed9ca9aba3
4 changed files with 57 additions and 56 deletions

View File

@ -100,7 +100,7 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
function sendRequest(endpoint, payload) { function sendRequest(endpoint, payload) {
return fetch(`http://api.servii.fr:3000/${endpoint}`, { return fetch(`https://176.165.62.226:3000/${endpoint}`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'

10
app.py
View File

@ -9,8 +9,8 @@ import generic_executor
app = Flask(__name__) app = Flask(__name__)
CORS(app) CORS(app)
cors = CORS(app, origins=['*']) cors = CORS(app, origins="*")
apiBP = Blueprint('apiBP', 'BPapi', subdomain="api") apiBP = Blueprint('apiBP', 'BPapi')
def generic_response_maker(status_code: http.HTTPStatus, _message: str = None) -> tuple[Response, int]: def generic_response_maker(status_code: http.HTTPStatus, _message: str = None) -> tuple[Response, int]:
@ -113,7 +113,7 @@ def dynamic_route_handler(path):
return generic_response_maker(http.HTTPStatus.BAD_REQUEST, str(e)) return generic_response_maker(http.HTTPStatus.BAD_REQUEST, str(e))
app.register_blueprint(apiBP)
if __name__ == '__main__': if __name__ == '__main__':
ssl_context = ('./secrets/fullchain.pem', './secrets/privkey.pem') app.run(host='0.0.0.0', port=3000, debug=False)
app.register_blueprint(apiBP)
app.run(host='0.0.0.0', port=3000, debug=False, ssl_context=ssl_context)

View File

@ -1,25 +1,27 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIEFTCCAv2gAwIBAgIUHYSCCL5ZS6rBhAReH/NaYM5aRbgwDQYJKoZIhvcNAQEL MIIEnjCCA4agAwIBAgIUWBbhL99wo5o2f7PzIyjuJx+WE6wwDQYJKoZIhvcNAQEL
BQAwgagxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFA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