When using node.js to open the server, I encountered an issue where the styles are not displaying. Strangely, when opening index.html directly in the browser, all the styles show up correctly. What could be causing this discrepancy? index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="style/style.css" type="text/css" />
<title>Socket.IO chat</title>
</head>
index.js
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const port = 3000;
app.use(express.static(__dirname + '/style/style.css'));
app.get('/', (request, response ) => {
response.sendFile(__dirname + '/index.html');
});
server.listen(port, () => {
console.log(`listening on port ${port}`);
});