Kirim File HTML Express
res.sendFile(path.join(__dirname + '/index.html'));
Lucky Lapwing
res.sendFile(path.join(__dirname + '/index.html'));
app.get('/test', function(req, res) {
res.sendFile('test.html', {root: __dirname })
});
//res.sendFile(path [, options] [, fn])
app.get('/test', function(req, res) {
res.sendFile('test.html')
});
// Express.JS: Send HTML from string
res.send(`
<h1>Welcome</h1>
<h2>Scroll to learn more</h2>
`);