Sharing my main.ts file in which I am facing issues with linking my css and js files. view image
import express from 'express';
import {Request,Response} from 'express';
import expressSession from 'express-session';
import path from 'path';
const app = express();
// initializing session
app.use(expressSession({
resave:true,
saveUninitialized:true
}));
// setting up server to serve the main page//
app.get("/", (req: Request, res: Response) => {
res.sendFile(path.resolve(__dirname, "../frontend/public/index.html"));
});
app.use(express.static('public'))
const PORT = 8080;
app.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}/`);
});
Also attaching the layout of my file structure for reference view image In addition, adding a link to my html file below view image