So you need to set up a project and serve static files (HTML, CSS, JS..). In Nodejs, you can do it easily with Express. For example, you can have this in your server.js :
// require libraries
const path = require("path");
const express = require("express");
const ejs = require("ejs");
// initiate express app
const app = express();
// config express app
app.use('/', express.static("public"));// express app serves static files (css, js...) in "public" folder
// to include the stylesheet at public/css/style.css, we use <link rel="stylesheet" href="/css/style.css">
// to include the script at public/script/script.js, we use <script src="/script/script.js"></script>
// you can put index.html in /public folder
app.listen(5000, function () { console.log("Server is listening on port 5000") });
// your page will be available at http://localhost:5000
And the folder structure is
node_modules
public
index.html
css
style.css
script
script.js
server.js
I've created a working project here. The code is self-documented. Feel free to test it :). In the boilerplate, you don't need the ejs part, just put your index.html file in the /public folder.