send html file express

39

express send html file -

app.get('/test', function(req, res) {
    res.sendFile('test.html', {root: __dirname })
});

express return html file -

//res.sendFile(path [, options] [, fn])
app.get('/test', function(req, res) {
    res.sendFile('test.html')
});

Comments

Submit
0 Comments