app.main   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 21
dl 0
loc 35
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A create_app() 0 23 1
1
from quart import Quart, render_template
2
3
from .bot import bot_blueprint
4
from .site.routes import site_blueprint
5
6
7
def create_app():
8
    """
9
    Create app
10
    """
11
12
    new_app = Quart(__name__)
13
    new_app.register_blueprint(bot_blueprint, url_prefix="/bot")
14
    new_app.register_blueprint(site_blueprint, url_prefix="/site")
15
    new_app.debug = False
16
17
    @new_app.errorhandler(404)
18
    async def page_not_found(_):
19
        return await render_template("404.html"), 404
20
21
    @new_app.route("/", methods=["GET"])
22
    @new_app.route("/index")
23
    async def index():
24
        """
25
        example endpoint
26
        """
27
        return await render_template("index.html")
28
29
    return new_app
30
31
32
if __name__ == "__main__":
33
    app = create_app()
34
    app.run()
35