I've decided to challenge myself by creating a small webhost using Node.js with hapi. Even though I'm not an expert in Node.js, I am eager to learn as much as possible.
Currently, my main issue revolves around fetching a CSS file from an include directory. In my app.js code using Hapi, it looks like the following:
var Path = require("path");
var Hapi = require('hapi');
var HandleBars = require('handlebars');
var server = new Hapi.Server();
server.views({
engines: {
html: HandleBars
},
path: './views'
});
// Rest of the server setup code here...
My index.html file contains relevant HTML and includes references to CSS files. However, when running the host locally via Heroku, the main.css file cannot be found even though the console logs show the correct path. It results in a 404 error. Can someone provide guidance on how to resolve this issue? Any help would be greatly appreciated. Thank you!