Skip to content

Commit 672fab3

Browse files
fhinkelAce Nassri
authored andcommitted
Simplify JS and use HTML standard (#91)
1 parent 12293ce commit 672fab3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compute/startup-script/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ function createVm(name, callback) {
3939
apt-get update
4040
apt-get install -y apache2
4141
cat <<EOF > /var/www/html/index.html
42-
<html><body><h1>Hello World</h1>
43-
<p>This page was created from a simple start up script!</p>
44-
</body></html>`,
42+
<!doctype html>
43+
<h1>Hello World</h1>
44+
<p>This page was created from a simple start-up script!</p>`,
4545
},
4646
],
4747
},
@@ -62,8 +62,8 @@ function createVm(name, callback) {
6262
const metadata = data[0];
6363

6464
// External IP of the VM.
65-
const ip = metadata['networkInterfaces'][0]['accessConfigs'][0]['natIP'];
66-
console.log('Booting new VM with IP http://' + ip + '...');
65+
const ip = metadata.networkInterfaces[0].accessConfigs[0].natIP;
66+
console.log(`Booting new VM with IP http://${ip}...`);
6767

6868
// Ping the VM to determine when the HTTP server is ready.
6969
let waiting = true;

0 commit comments

Comments
 (0)