I created a basic HTML file which loads successfully. But for some reason, no JS, CSS or images will load (HTTP 404).
When I look in the Chrome Network tab, I can see the link is ok (ie: “glitch.me/date.js”). The ‘date.js’ file is also in the root of my app folder and the HTML has: .
All my other JavaScript files, CSS and date are the same.
The ‘/form/1’ is simply a specification that I must adhere to which is to feed the HTML page via a REST API. As you can see the file is loaded and displayed correctly. But doing F12 in Chrome, the Network tab indicates that all dependent resources (javascript libs) won’t load (HTTP 404).
I tried with an absolute path ‘/date.js’, relational ‘date.js’ and what I was initially trying ‘js/date.js’ (in a folder). But nothing works.
This is my first few days on glitch (having many problems, not too impressed) and just basic knowledge of Node.js with limited experience. I’m assuming all files in the root are served directly from your servers?
Found these two bits of information which seems like what I was looking for:
Will be trying them to see if it works. Although exposing a ‘public’ folder (or a ‘js’, ‘css’ and ‘images’ would be preferred) over adding routing maps in Node.js.
Now I just have to figure out why when I copy files in the Console it never shows up in my project. Same goes with creating directories, etc.
With your current setup, your jQuery files should be in a directory called ‘public’ e.g. public/jquery…
We recommend using the editor directly to create files. The console and editor file tree don’t automatically sync. Use the command ‘refresh’ to get the file tree editor to show updates made with the console.