Friday 28 July 2017

Keep getting 404 not found when trying to link external JS file.

I have a JS file with the structure like so:- main folder ... - node_modules - views ---pages (folder) ---partials (folder) ---script.js ... In my .ejs file I try to use this .js file like so:I keep getting this error:GET http://localhost:1337/views/script.js 404 (Not Found) I also have this set in my app.jsapp.set('/views', express.static(path.join(__dirname, '/views'))); app.set('view engine', 'ejs');

Submitted July 28, 2017 at 12:39PM by farhansyed7911

No comments:

Post a Comment