2019-10-07 23:28:11 +00:00
|
|
|
from app import create_app, db
|
2019-10-06 00:49:49 +00:00
|
|
|
|
|
|
|
# Blueprints
|
2019-10-09 00:18:40 +00:00
|
|
|
from api.api import register_api_endpoints
|
2019-10-06 00:49:49 +00:00
|
|
|
from auth.auth import auth
|
|
|
|
|
2019-10-07 23:28:11 +00:00
|
|
|
# Web sockets
|
|
|
|
from websockets.socket import socketio
|
|
|
|
|
2019-10-06 05:40:02 +00:00
|
|
|
import configuration.models_mount
|
|
|
|
from flask_migrate import Migrate
|
2019-10-06 00:49:49 +00:00
|
|
|
|
2019-10-12 18:28:21 +00:00
|
|
|
from flask import Blueprint, jsonify
|
|
|
|
|
|
|
|
server = Blueprint('server', __name__, url_prefix='/')
|
|
|
|
|
|
|
|
@server.route('/', methods=['GET'])
|
|
|
|
def api_home():
|
|
|
|
response = {"message": "hello world"}
|
|
|
|
return jsonify(response)
|
|
|
|
|
2019-10-06 00:49:49 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
app = create_app()
|
2019-10-09 00:18:40 +00:00
|
|
|
register_api_endpoints(app)
|
2019-10-12 18:28:21 +00:00
|
|
|
app.register_blueprint(server)
|
2019-10-06 05:40:02 +00:00
|
|
|
migrate = Migrate(app, db)
|
2019-10-12 18:28:21 +00:00
|
|
|
socketio.run(app, debug=True)
|
2019-10-12 19:34:05 +00:00
|
|
|
|
2019-10-12 19:50:58 +00:00
|
|
|
def run():
|
2019-10-12 19:34:05 +00:00
|
|
|
app = create_app()
|
|
|
|
register_api_endpoints(app)
|
|
|
|
app.register_blueprint(server)
|
|
|
|
migrate = Migrate(app, db)
|
|
|
|
socketio.run(app, debug=False)
|