I created a VueJs page with the CLI. I would like to show it to other people without having the Vue CLI or Node installed. Just like you normally open .html files in your browser I would like to open the index.html file after building it.
When I open the file I get an empty page with 404 error messages in the console. I took these docs
https://cli.vuejs.org/guide/deployment.html#general-guidelines
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
and added mode: "history", to my router object. After building the project with the Vue CLI I setup a simple Node server
const http = require('http');
const server = http.createServer();
const fs = require('fs');
const port = 3000;
server.on('request', async (req, res) => {
const htmlContent = fs.readFileSync('./index.html', 'utf-8');
res.writeHead(200, {
'Content-Type': 'text/html; charset=utf-8'
});
res.end(htmlContent);
});
server.listen(port, err => {
console.log(`server is listening on ${port}`)
})
When running the server I call http://localhost:3000/ and get an empty page with two errors
What am I missing?
