2018-04-27 08:47:24 +00:00
|
|
|
# App initialization
|
2018-04-14 11:44:47 +00:00
|
|
|
from flask import Flask
|
2018-04-26 12:51:37 +00:00
|
|
|
from flask_sqlalchemy import SQLAlchemy
|
2018-04-25 13:51:28 +00:00
|
|
|
|
|
|
|
app = Flask(__name__, instance_relative_config=True)
|
|
|
|
app.config.from_object('config')
|
|
|
|
app.config.from_pyfile('config.py')
|
2018-04-26 12:51:37 +00:00
|
|
|
db = SQLAlchemy(app)
|
2018-04-27 08:47:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Blueprints setup
|
|
|
|
from app.mod_devices import setup_mqtt, tear_down_mqtt, devices
|
|
|
|
|
2018-04-26 14:45:28 +00:00
|
|
|
app.register_blueprint(devices, url_prefix='/devices')
|
2018-04-14 11:44:47 +00:00
|
|
|
|
2018-04-26 13:03:38 +00:00
|
|
|
|
2018-04-14 11:44:47 +00:00
|
|
|
@app.route("/")
|
|
|
|
def hello():
|
|
|
|
return "Hello World!"
|