diff options
| author | DavidRThrashJr <60800614+DavidRThrashJr@users.noreply.github.com> | 2020-02-20 03:35:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-20 09:35:03 +0100 |
| commit | 72653c0d3ac5ea5265479e7e53ff39cfe62a00ce (patch) | |
| tree | cc303e2fdd681ab3c9914716443c6fad392ca55f /ihatemoney/run.py | |
| parent | 32d76178c0ebe05bddb596f85b283f3f0ee74c85 (diff) | |
| download | ihatemoney-mirror-72653c0d3ac5ea5265479e7e53ff39cfe62a00ce.zip ihatemoney-mirror-72653c0d3ac5ea5265479e7e53ff39cfe62a00ce.tar.gz ihatemoney-mirror-72653c0d3ac5ea5265479e7e53ff39cfe62a00ce.tar.bz2 | |
Added support for multiple API versions (#533)
* Added support for multiple API versions
Note that no changes were made to the api, the code was refactored to allow for new versions of the api to be created down the road.
Here's what this would look like:
+-- api/
+-- v1/
+-- __init__.py
+-- resources.py
+-- v1_1/
+-- __init__.py
+-- resources.py
+-- v2/
+-- __init__.py
+-- resources.py
+-- __init__.py
+-- common.py
* reformatted using black
/Users/drthrash/PycharmProjects/ihatemoney/ihatemoney/api/v1/resources.py
reformatted /Users/drthrash/PycharmProjects/ihatemoney/ihatemoney/api/common.py
All done! ✨ 🍰 ✨
* Applying fix for unused import in init.py
https://stackoverflow.com/questions/31079047/python-pep8-class-in-init-imported-but-not-used
* Formatting changes recommended by black
All done! ✨ 🍰 ✨
1 file reformatted, 22 files left unchanged.
Diffstat (limited to 'ihatemoney/run.py')
| -rw-r--r-- | ihatemoney/run.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ihatemoney/run.py b/ihatemoney/run.py index 6d1e032..161761c 100644 --- a/ihatemoney/run.py +++ b/ihatemoney/run.py @@ -8,7 +8,7 @@ from flask_mail import Mail from flask_migrate import Migrate, upgrade, stamp from werkzeug.middleware.proxy_fix import ProxyFix -from ihatemoney.api import api +from ihatemoney.api.v1 import api as apiv1 from ihatemoney.models import db from ihatemoney.utils import ( IhmJSONEncoder, @@ -132,7 +132,7 @@ def create_app( validate_configuration(app) app.register_blueprint(web_interface) - app.register_blueprint(api) + app.register_blueprint(apiv1) app.register_error_handler(404, page_not_found) # Configure the a, root="main"pplication |
