I'm trying to learn rocket.rs and create a simple app which render a index.html and statics files.
below is a sketch for the beginning, but I'm having problems with the static css and js files that are not identified, by default rocket read a folder in the root directory called templates, I created this folder, put a file index.html.hbs and works, but it doesn't read the js and css files created within the templates/static/js and css folder, is there any way for this to work without using other libs, just the two I'm using
Now you can access the files with something like <script src='/assets/js/custom.js'></script>. Note that the assets folder should be at the root of the project (on the same level as the Cargo.toml file), not in the templates folder.
@crazydump I think that it is, generally, bad practice to keep static files like css and js inside the templates folder. The template folder is reserved for templates. Also, it makes it easier to understand for other people taking a look at your code.