mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-18 05:50:31 +00:00
[+] New blueprint method
[+] Allows subdomain filtering for routes [+] Allows routes scalability Signed-off-by: Charles Le Maux <charles.le-maux@epitech.eu>
This commit is contained in:
parent
166ab2f198
commit
fe51740ce0
4
app.py
4
app.py
@ -10,7 +10,7 @@ import generic_executor
|
|||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
CORS(app)
|
CORS(app)
|
||||||
cors = CORS(app, origins=['*'])
|
cors = CORS(app, origins=['*'])
|
||||||
apiBP = Blueprint('api', 'api', subdomain="api")
|
apiBP = Blueprint('apiBP', 'BPapi', subdomain="api")
|
||||||
|
|
||||||
|
|
||||||
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]:
|
||||||
@ -114,6 +114,6 @@ def dynamic_route_handler(path):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ssl_context = ('/secrets/fullchain.pem', '/secrets/privkey.pem')
|
ssl_context = ('./secrets/fullchain.pem', './secrets/privkey.pem')
|
||||||
app.register_blueprint(apiBP)
|
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, ssl_context=ssl_context)
|
||||||
|
Loading…
Reference in New Issue
Block a user