When I’m building an index.html or anything else particularly simple, I like
to spin up a web server with Vercel’s serve package. It’s this easy:
npx serve .
Your HTML file, scripts, and stylesheets will be available on port 3000.
You can serve on another port if 3000 is taken, which is frequently true on my machine:
npx serve . -l 3001
The package chooses a free port in this case, flag or not, so there’s never a conflict.
- serve – NPM package