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

Use FlaskAPI to autogen open api docs. #50

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions voting_api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = "pypi"
flask = "*"
google-cloud-storage = "*"
gunicorn = "*"
apiflask = {extras = ["yaml"], version = "*"}

[dev-packages]
pytest = "*"
Expand Down
144 changes: 125 additions & 19 deletions voting_api/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions voting_api/voting/api.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import os

from flask import Flask, jsonify, request
from apiflask import APIFlask
from flask import jsonify, request

from voting.storage import art_storage


def create_app():
app = Flask(__name__)
app = APIFlask(__name__)
return app


app = create_app()


@app.route("/health")
@app.get("/health")
def health_check():
return 'OK'


@app.route("/art")
@app.get("/art")
def art():
gen = request.args.get('gen', -1)

Expand Down
Loading