AssertionError: View function mapping is overwriting an existing endpoint

Your view(API endpoint) names need to be unique even if they are pointing to the same view method.

Your Rest API code should be like this:

app.add_url_rule('/',                 view_func=Main.as_view('main'),                 methods = ['GET'])app.add_url_rule('//',                 view_func=Main.as_view('page'),                 methods = ['GET'])

Not Like this:

app.add_url_rule('/',                 view_func=Main.as_view('main'),                 methods=["GET"])app.add_url_rule('//',                 view_func=Main.as_view('main'),                 methods=["GET"])