Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add endpoint for server version #6524

Merged
merged 12 commits into from
Oct 19, 2019
4 changes: 3 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ def create_app():
from app.api.admin_translations import admin_blueprint
from app.api.orders import alipay_blueprint
from app.api.settings import admin_misc_routes
from app.api.server_version import info_route

app.register_blueprint(api_v1)
app.register_blueprint(event_copy)
app.register_blueprint(upload_routes)
app.register_blueprint(export_routes)
app.register_blueprint(import_routes)
app.register_blueprint(celery_routes)
app.register_blueprint(auth_routes)
app.register_blueprint(info_route)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still at the wrong place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved the /info_route and /import_route to its original place. Do you want me to put /info_route end?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info_route had no original place as it's a new route and should be placed in the end

app.register_blueprint(event_statistics)
app.register_blueprint(user_misc_routes)
app.register_blueprint(attendee_misc_routes)
Expand All @@ -167,6 +168,7 @@ def create_app():
app.register_blueprint(admin_blueprint)
app.register_blueprint(alipay_blueprint)
app.register_blueprint(admin_misc_routes)
app.register_blueprint(import_routes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this to where it was


add_engine_pidguard(db.engine)

Expand Down
11 changes: 11 additions & 0 deletions app/api/server_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from flask import jsonify, Blueprint

SERVER_VERSION = '1.7.0-SNAPSHOT'

info_route = Blueprint('info', __name__, url_prefix='/v1')
_build = {'version': SERVER_VERSION}


@info_route.route('/info')
def version():
return jsonify(build=_build)