-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
iamareebjamal
merged 12 commits into
fossasia:development
from
adhibhuta:server_version
Oct 19, 2019
Merged
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b4836de
Add rest endpoint for server version
adhibhuta e69c599
Fix error message
adhibhuta cf742bd
Fix the hound issues
adhibhuta 44247d3
Change route to '/info' and modify json to include timestamp
adhibhuta 04059bd
Merge branch 'development' into server_version
adhibhuta 2389f3c
Remove the class and define the method only for /info route
adhibhuta ed0ceea
Merge branch 'server_version' of https://github.com/lladhibhutall/ope…
adhibhuta 64f7891
move import and register blueprint to end
adhibhuta ec039f8
register blueprint to end for info route
adhibhuta dfc56db
put register blueprint for info_route back
adhibhuta 63a4f89
Move the register blueprints to original place
adhibhuta 3dee4df
Update __init__.py
iamareebjamal File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from flask import jsonify, Blueprint | ||
|
||
|
||
SERVER_VERSION = '1.0' | ||
|
||
server_version_route = Blueprint('server_version', __name__, url_prefix='/v1') | ||
|
||
|
||
class ServerVersion: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expected 2 blank lines, found 1 |
||
@staticmethod | ||
@server_version_route.route('/server_version') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make it This JSON should be the output {
"build": {
"version": "2.2.3-SNAPSHOT",
"time": "2019-10-15T07:26:58.080Z"
}
} |
||
def version(): | ||
return jsonify(server_version=SERVER_VERSION) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'app.api.server_version.ServerVersion' imported but unused