Trying to make the simplest "hello world" example of express server in node js , on a google VM machine and it does not work. What I am trying to do is NOT use the APP ENGINE of google , I am just trying as a 1st step to create a NODE JS server on the google compute machine and connect by http. I used the google code example of "hello world" for node js and to use the http://MY_VM_EXTERNAL_IP_ADDRESS:8080 to connect in the browser - no luck. I am sure I am missing something stupid but not sure what :-(.
'use strict';
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.status(200).send('Hello, world!');
});
// Start the server
const PORT = process.env.PORT || 8080;
app.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
console.log('Press Ctrl+C to quit.');
});