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

[code style]declare endpoints style #158

Description

@johnsmithm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions