browser-go-api/server.py
2019-10-12 12:34:05 -07:00

34 lines
814 B
Python

from app import create_app, db
# Blueprints
from api.api import register_api_endpoints
from auth.auth import auth
# Web sockets
from websockets.socket import socketio
import configuration.models_mount
from flask_migrate import Migrate
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)
if __name__ == '__main__':
app = create_app()
register_api_endpoints(app)
app.register_blueprint(server)
migrate = Migrate(app, db)
socketio.run(app, debug=True)
def server():
app = create_app()
register_api_endpoints(app)
app.register_blueprint(server)
migrate = Migrate(app, db)
socketio.run(app, debug=False)