Answers for "send an html file and data with express"

9

send html file express

res.sendFile(path.join(__dirname + '/index.html'));
Posted by: Guest on March-05-2020
0

express return html file

//res.sendFile(path [, options] [, fn])
app.get('/test', function(req, res) {
    res.sendFile('test.html')
});
Posted by: Guest on February-08-2022

Browse Popular Code Answers by Language