예제 #1
0
def app():
    app = SkyLines(config_file=config.TESTING_CONF_PATH)
    _db.init_app(app)

    oauth.init_app(app)

    @app.route('/')
    @oauth.require_oauth()
    def index():
        return 'success'

    return app
예제 #2
0
def app():
    app = SkyLines(config_file=config.TESTING_CONF_PATH)
    _db.init_app(app)

    oauth.init_app(app)
    cors.init_app(app)

    @app.route('/secrets')
    @oauth.required()
    def secrets():
        return jsonify({'secrets': [1, 1, 2, 3, 5, 8, 13]})

    @app.route('/user')
    @oauth.optional()
    def user():
        return jsonify({'user': request.user_id})

    return app
예제 #3
0
def app():
    app = SkyLines(config_file=config.TESTING_CONF_PATH)
    _db.init_app(app)

    oauth.init_app(app)
    cors.init_app(app)

    @app.route('/secrets')
    @oauth.required()
    def secrets():
        return jsonify({'secrets': [1, 1, 2, 3, 5, 8, 13]})

    @app.route('/user')
    @oauth.optional()
    def user():
        return jsonify({'user': request.user_id})

    return app
예제 #4
0
def app():
    app = SkyLines(config_file=config.TESTING_CONF_PATH)
    app.response_class = ApiResponse
    _db.init_app(app)

    oauth.init_app(app)
    cors.init_app(app)

    @app.route("/secrets")
    @oauth.required()
    def secrets():
        return jsonify({"secrets": [1, 1, 2, 3, 5, 8, 13]})

    @app.route("/user")
    @oauth.optional()
    def user():
        return jsonify({"user": request.user_id})

    return app
예제 #5
0
def app():
    app = SkyLines(config_file=config.TESTING_CONF_PATH)
    app.response_class = ApiResponse
    _db.init_app(app)

    oauth.init_app(app)
    cors.init_app(app)

    @app.route("/secrets")
    @oauth.required()
    def secrets():
        return jsonify({"secrets": [1, 1, 2, 3, 5, 8, 13]})

    @app.route("/user")
    @oauth.optional()
    def user():
        return jsonify({"user": request.user_id})

    return app
예제 #6
0
파일: app.py 프로젝트: yataOrg/skylines
    def add_sqlalchemy(self):
        """ Create and configure SQLAlchemy extension """
        from skylines.database import db

        db.init_app(self)
예제 #7
0
파일: app.py 프로젝트: RBE-Avionik/skylines
 def add_sqlalchemy(self):
     """ Create and configure SQLAlchemy extension """
     from skylines.database import db
     db.init_app(self)