Closed wojcikstefan closed 2 years ago
Thus making us more consistent with the approach recommended at http://flask.pocoo.org/docs/0.10/extensiondev/#the-extension-code
We should be able to enable the API in two ways:
MongoRest(app)
api = Mongorest()
app = create_app('the-config.cfg')
api.init_app(app)
In the 1st case, MongoRest's __init__ should call init_app.
MongoRest
__init__
init_app
See https://github.com/closeio/flask-mongorest/pull/55 for a proposed solution that unfortunately never made it to the master.
Let's get this done. I commented in #55 that I'd like to work at getting it merged
Thus making us more consistent with the approach recommended at http://flask.pocoo.org/docs/0.10/extensiondev/#the-extension-code
We should be able to enable the API in two ways:
MongoRest(app)
(already supported).api = Mongorest()
-> app creation (e.g.app = create_app('the-config.cfg')
) ->api.init_app(app)
.In the 1st case,
MongoRest
's__init__
should callinit_app
.See https://github.com/closeio/flask-mongorest/pull/55 for a proposed solution that unfortunately never made it to the master.