Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

[code style]declare endpoints style #158

Open
johnsmithm opened this issue Jan 16, 2021 · 0 comments
Open

[code style]declare endpoints style #158

johnsmithm opened this issue Jan 16, 2021 · 0 comments
Labels
question Further information is requested

Comments

@johnsmithm
Copy link
Contributor

now we have in code two ways to declare endpoints, one way is in the app.py file, another is declaring endpoints inside a function like register function from requests.py


def register(app, auth):
    @app.route("/api/requests/filters/<page>/<per_page>", methods=["GET"])
    @auth.login_required
    def get_requests_by_filters(page=1, per_page=10):
        return requests_by_filters(request.args, page, per_page)

There is another way, using MethodView, but it is not used at all.
Let's discuss what style we select.

@johnsmithm johnsmithm added the question Further information is requested label Jan 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant