I am currently developing a website using Node.js, I just set up my 404 page, and it works fine when I go to something like mywebsite.com/404 or another page that doesnt exist, but if I go to something like mywebsite.com/foo/bar, which doesn't exist, the assets like CSS and JS don't load. I am using app.use('/assets', express.static(__dirname + '/public'));
on the server and <link href="/assets/css/bootstrap.min.css" rel="stylesheet">
on the page itself. I know that adding a ../ in front of the assets on the HTML will work, but that is not ideal. Any help?
via Kobey Rafferty
No comments:
Post a Comment