404 when accessing resource Flask-Restful 404 when accessing resource Flask-Restful flask flask

404 when accessing resource Flask-Restful


Ok, the problem seems to be that the below ordering is wrong. I must add resources before I init the api.

api = Api()api.init_app(app)api.add_resource(HelloWorld, '/')

Fix:

api = Api()api.add_resource(HelloWorld, '/')api.init_app(app)

This is quite strange given that e.g. SQLAlchemy needs to call init_app before it is used...