Firebase Hosting can process dynamic requests with Cloud Functions. This works well, however if the page does not exist I'd like to show the 404.html page of the static site.
I cannot simply redirect to it, because then the 404 page is shown, but the status is 200.
I can return 404 from Flask with:
return "Not found", 404
but then only the Not found text is printed.
How can I return the 404.html file and return the 404 code at the same time from Flask? Does a Cloud Function invoked by Firebase Hosting "see" the files of the static site?