-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
26 lines (20 loc) · 689 Bytes
/
app.py
File metadata and controls
26 lines (20 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from dotenv import load_dotenv
from flask import Flask
load_dotenv()
HOST = os.getenv("APP_HOST")
PORT = int(os.getenv("APP_PORT"))
from routes.delete_users import delete_bp
from routes.get_users import get_bp
from routes.post_users import post_bp
from routes.put_users import put_bp
app = Flask(__name__)
# Register each blueprint with the main app
app.register_blueprint(post_bp)
app.register_blueprint(get_bp)
app.register_blueprint(put_bp)
app.register_blueprint(delete_bp)
if __name__ == "__main__":
# Flask defaults to 127.0.0.1:5000.
# If you see 3000, you explicitly set it like this:
app.run(debug=True, host=HOST, port=PORT)