-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
35 lines (22 loc) · 763 Bytes
/
server.py
File metadata and controls
35 lines (22 loc) · 763 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
27
28
29
30
31
32
33
34
35
from logging import getLogger
from logging import basicConfig as log_base_config
from logging import INFO as log_level_INFO
from flask import Flask
from Routes.Constitution.constitution import bp_constitution
VERSION = "v1"
# Flask Configration
app = Flask(__name__)
app.config["JSON_AS_ASCII"] = False
app.config["JSON_SORT_KEYS"] = False
app.config["JSONIFY_PRETTYPRINT_REGULAR"] = True
# Logging Configration
formatter = "%(asctime)s [%(levelname)s] in %(pathname)s %(lineno)d: %(message)s"
log_base_config(level=log_level_INFO, format=formatter)
# Make Logger
logger = getLogger(__name__)
# Set Routing
app.register_blueprint(bp_constitution, url_prefix=f"/{VERSION}/constitution")
def main():
app.run()
if __name__ == "__main__":
main()