flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

TODO Sample (todo_blueprint.py) is not working

Open heramoon42 opened this issue 1 year ago • 2 comments

Code

https://github.com/python-restx/flask-restx/blob/master/examples/todo_blueprint.py

Repro Steps (if applicable)

  1. Run this code
  2. Get into 127.0.0.1:5000
  3. Get 404 Error

Expected Behavior

I ran this code, but I can't see the swagger screen, I just get a 404 error. Can I fix it?

Environment

  • Python version 3.10
  • Flask version 3.0.3
  • Flask-RESTX version 1.3.0
  • Other installed Flask extensions

heramoon42 avatar Jul 21 '24 10:07 heramoon42

Im not near a computer right now to check but from memory the docs are served by default from the root of the API definition, not the global root route.

So you need to go to 127.0.0.1:5000/api/1 because that is the url the blueprint is set to use for the API in that example. If you want to serve it from /, remove the url prefix from the blueprint definition.

Message ID: @.***>

peter-doggart avatar Jul 21 '24 11:07 peter-doggart

Oh Thank you!

heramoon42 avatar Jul 24 '24 03:07 heramoon42