2020-03-09 18:35:02 +00:00
|
|
|
# Python imports
|
|
|
|
|
|
|
|
# Lib imports
|
2019-12-22 19:09:36 +00:00
|
|
|
from flask import request, render_template
|
|
|
|
|
2020-03-09 18:35:02 +00:00
|
|
|
# App imports
|
|
|
|
from core import app, db # Get from __init__
|
2020-03-06 07:27:02 +00:00
|
|
|
from core.models import Table # Get db models
|
|
|
|
from core.MessageHandler import MessageHandler # Get simple message processor
|
2019-11-01 22:54:25 +00:00
|
|
|
|
2019-12-22 19:09:36 +00:00
|
|
|
|
2019-11-01 22:54:25 +00:00
|
|
|
msgHandler = MessageHandler()
|
2020-03-09 18:35:02 +00:00
|
|
|
TITLE = app.config['TITLE']
|
2019-11-01 22:54:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
@app.route('/', methods=['GET', 'POST'])
|
|
|
|
def root():
|
|
|
|
if request.method == 'GET':
|
|
|
|
return render_template('index.html',
|
2020-03-09 18:35:02 +00:00
|
|
|
title=TITLE)
|
2020-01-12 19:32:47 +00:00
|
|
|
|
|
|
|
return render_template('error.html',
|
|
|
|
title='Error!',
|
|
|
|
message='Must use GET request type...')
|