Im trying to use url_for to get a Javascript file named 'game.js'. The file is located inside a folder called 'js' which itself is inside the static folder. The code im using is:
<script src="{{ url_for('static', filename='js/game.js') }}"></script>
This doesn't work. However, if I move the 'game.js' file to be just inside the static folder and not the js folder and use this line of code it works:
<script src="{{ url_for('static', filename='game.js') }}"></script>
Why doesn't it work when the file is inside the js folder?
File tree:
├───static
│ ├───css
│ └───js
| └───game.js
├───templates
│ ├───layout.html
│ └───index.html
└───app.py