python-restx / flask-restx

Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
https://flask-restx.readthedocs.io/en/latest/
Other
2.14k stars 333 forks source link

TODO Sample (todo_blueprint.py) is not working #608

Open Hera-Moon opened 1 month ago

Hera-Moon commented 1 month ago

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

peter-doggart commented 1 month ago

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: @.***>

Hera-Moon commented 1 month ago

Oh Thank you!