Forums

Can I catch a call to a URL inside my static folder?

Hello,

I'm working with a Javascript library that makes calls to a connector. The connector URL is inside the static folder, and I don't seem to be able to find anyway to change that - is there any way I can 'catch' the static call in Flask before it's served by the webserver?

Thanks, Robert

Unfortunately not. If you could, then we'd need to ping your Flask app to check whether it handled any given URL before we could delegate the query to the static files handler, which would make static files much less useful -- their speed advantage comes from the fact that your Python code isn't involved in serving them.