1

I'm am just starting a new project with python's flask and am looking to prepend /api to each route, so that every access looks like this: /api/user/.. or /api/post/...

I would like to write this:
@app.route("/users") instead of this @app.route("/api/users") for each route.

The flask documentation for route registration (http://flask.pocoo.org/docs/0.10/api/#url-route-registrations) only describes how to add a route for a specific view.

Is there a way to register a prefix or do I need to write /api in every route?

Lawrence Benson
  • 1,398
  • 1
  • 16
  • 33

0 Answers0