slinky/main.py

27 lines
602 B
Python

"""
Main Flask-based app for Slinky
"""
from flask import Flask, Response, render_template
from flask_bootstrap import Bootstrap # type: ignore[import]
from werkzeug.middleware.proxy_fix import ProxyFix
from slinky.web import protect, slinky_webapp
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1) # type: ignore[assignment]
app.register_blueprint(slinky_webapp)
Bootstrap(app)
@app.route('/')
@protect
def index() -> Response:
"""
Index/Landing page
Returns:
str: string of page content
"""
return Response(render_template('index.html'), 200)