amigo21
amigo21

Reputation: 391

Failed to load resources node js application

I am trying to load my custom js file into my application but it's not working. I use node app engine to set the html through 'ejs' and the index.html renders perfectly. It's just the js file that doesn't get recognized.

Any tips would be appreciated.

Below is my project structure, html code, and the errors i'm getting.

Project structure and some html code

enter image description here

enter image description here

Upvotes: 0

Views: 776

Answers (1)

neilsimp1
neilsimp1

Reputation: 1259

Your functions.js file shouldn't be in the views folder. Move that into public/js/. That is where express will look for that static files to serve.

The views folder is really only for ejs files, in your case.

Upvotes: 2

Related Questions