I'm trying to serve a web page from google functions in python using flask / jinja.
The trouble is that google functions seems can't find my static files (js/css) as if I merge css / js in my html then it work well.
The error is then : Resource interpreted as Stylesheet but transferred with MIME type text/html : http://MyGoogleCloudFunctionPath.net/static/styles/main.css
My folder structure is:
app.py
app.yaml
static/js/reader.js
static/css/main.css
templates/index.html
In my html file i'm calling my file this way
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='styles/main.css') }}">
<script type="text/javascript" src="{{ url_for('static', filename='js/reader.js') }}"></script>
And I added a Yaml as adviced here [google static files][1]
handlers:
- url: /static
static_dir: static
- url: /css
static_dir: static/styles
- url: /js
static_dir: static/js
Also i'm using HTTP as I load ressource which are http from other sites.
In the end I think google is not looking in the local files but trying to access www.googlefunctions/FOLDER_PATH/files
[1]: https://cloud.google.com/appengine/docs/standard/python/getting-started/serving-static-files