You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, flask-shell2http works just like any other flask extension; you create an object from a class to which you pass the flask application instance. We could follow a different approach making it solely available as a pluggable Flask.Blueprint.
Some initial ideas:
The Shell2HTTP class could derive from the Flask.Blueprint class; that way we can drop the init_app method, the register_command can be a wrapper over the Flask.Blueprint.add_url_rule method (it already is, but it works on app.add_url_rule). Then, the enduser would do something like,
fromflask_shell2httpimportShell2HTTP# default blueprint instantiationshell2http_bp=Shell2HTTP('awesome', __name__, url_prefix='/commands')
# extra method by flask-shell2httpshell2http_bp.register_command(endpoint="echo", command_name="echo", ...)
This would open doors for many other features since Flask.Flask and Flask.Blueprint derive from the same abstract base class and flask blueprints are very powerful.
The text was updated successfully, but these errors were encountered:
Currently, flask-shell2http works just like any other flask extension; you create an object from a class to which you pass the flask application instance. We could follow a different approach making it solely available as a pluggable
Flask.Blueprint
.Some initial ideas:
Shell2HTTP
class could derive from theFlask.Blueprint
class; that way we can drop theinit_app
method, theregister_command
can be a wrapper over theFlask.Blueprint.add_url_rule
method (it already is, but it works onapp.add_url_rule
). Then, the enduser would do something like,and then in the application factory,
This would open doors for many other features since
Flask.Flask
andFlask.Blueprint
derive from the same abstract base class and flask blueprints are very powerful.The text was updated successfully, but these errors were encountered: