1

I want to create rest api for my app with Flask. Is It possible to run flask with base route fe. localhost:5000/webservice that

@app.route('/users')

will handle localhost:5000/webservice/users?

Jarosław Krajewski
  • 520
  • 1
  • 7
  • 18

1 Answers1

3

Use Flask blueprints. When registering the blueprint you can add a url prefix.

app.register_blueprint(restapi, url_prefix='/webservice')

Here is a link to the flask blueprint docs: Flask Blueprints

Neill Herbst
  • 2,072
  • 1
  • 13
  • 23