app.use(express.static(path.join(__dirname, 'public')));
To implement this feature in your app.js file, you need to create a folder named public and place the style.css file inside it. Your code should look like this:
const express = require('express');
const path = require('path');
const app = express();
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'))
app.use(express.static(path.join(__dirname, 'public'))); // Make sure to add this line
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, '/index.html'));
});
const port = process.env.PORT || 5000;
app.listen(port, () => {
console.log(`Server is running on port ${port}`)
})