[~] 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) {
return fetch(`http://api.servii.fr:3000/${endpoint}`, {
return fetch(`https://176.165.62.226:3000/${endpoint}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'

10
app.py
View File

@ -9,8 +9,8 @@ import generic_executor
app = Flask(__name__)
CORS(app)
cors = CORS(app, origins=['*'])
apiBP = Blueprint('apiBP', 'BPapi', subdomain="api")
cors = CORS(app, origins="*")
apiBP = Blueprint('apiBP', 'BPapi')
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))
app.register_blueprint(apiBP)
if __name__ == '__main__':
ssl_context = ('./secrets/fullchain.pem', './secrets/privkey.pem')
app.register_blueprint(apiBP)
app.run(host='0.0.0.0', port=3000, debug=False, ssl_context=ssl_context)
app.run(host='0.0.0.0', port=3000, debug=False)

View File

@ -1,25 +1,27 @@
-----BEGIN CERTIFICATE-----
MIIEFTCCAv2gAwIBAgIUHYSCCL5ZS6rBhAReH/NaYM5aRbgwDQYJKoZIhvcNAQEL
BQAwgagxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH
Ew1TYW4gRnJhbmNpc2NvMRkwFwYDVQQKExBDbG91ZGZsYXJlLCBJbmMuMRswGQYD
VQQLExJ3d3cuY2xvdWRmbGFyZS5jb20xNDAyBgNVBAMTK01hbmFnZWQgQ0EgOWIw
MGIyZGY4ZjI4NjE4OTdiYWE4MmU5NTY1YjhiYTIwHhcNMjQwNjI5MTY0OTAwWhcN
MzQwNjI3MTY0OTAwWjAi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