I'm using this way to set it
app = Flask(__name__)
app.config['APPLICATION_ROOT'] = "/api"
@app.route("/posts")
def posts():
...
return response, 200
I want to get the endpoint as:
http://localhost:5000/api/posts
But can't show correctly. Got 404 Not Found error.
If use @app.route("/api/posts")
, it works.
APPLICATION_ROOT
is a builtin feature, why it doesn't work?