mirror of
https://github.com/NovaOSS/nova-web.git
synced 2024-11-25 18:53:58 +01:00
43 lines
942 B
Python
43 lines
942 B
Python
import os
|
|
import flask
|
|
import logging
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
|
|
log = logging.getLogger('werkzeug')
|
|
log.disabled = True
|
|
|
|
def create_app() -> flask.Flask:
|
|
app = flask.Flask(__name__)
|
|
|
|
@app.context_processor
|
|
def inject_variables():
|
|
return {
|
|
'contact_email': os.getenv('CONTACT_EMAIL')
|
|
}
|
|
|
|
@app.route('/')
|
|
def index():
|
|
return flask.render_template('index.html')
|
|
|
|
|
|
@app.route('/panel')
|
|
def panel():
|
|
return flask.render_template('panel.html')
|
|
|
|
@app.route('/favicon.ico')
|
|
def favicon():
|
|
return flask.send_file('static/img/fav.ico', mimetype='image/vnd.microsoft.icon')
|
|
|
|
@app.route('/legal/<path:subpath>')
|
|
def legal_site(subpath):
|
|
return flask.render_template(f'legal/{subpath}.html')
|
|
|
|
return app
|
|
|
|
if __name__ == '__main__':
|
|
create_app().run(debug=True, use_evalex=False, port=2323, host='0.0.0.0', threaded=True)
|