I am new to nodeJs and I got the sample project below to start working on. I have a client folder which has index.html file and index.js and2 other .js files. From my html I have referred index.js
<body style="margin: 0; padding: 10px;">
<div id="app"></div>
<script type="module" src="index.js"></script>
</body>
And in my index.js I have
import { testApp } from "./testApp.js"
const appElement = document.getElementById('app')
const app = testApp()
app.attach(appElement)
In my server folder, I have server.js file and one file for apiService. If I run npm install and npm start, it shows my server is running. I can access the server api calls from browser. However I am not sure how to access this index.html page.
I am getting the below error if I use index.js in the client file as the main entry in package.json.
Uncaught ReferenceError: document is not defined
Can you please help on how to run this client html file and JS file, so that I can access this server calls from the html file.