Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs: send html file to show in Browser

// Send HTML File to Browser
    fs.readFile(path, { encoding: 'utf-8' }, (err, data) => {
        if (err) {
            console.log(err);
            res.end();
            return
        }
        res.write(data);
        res.end();
    });
 
PREVIOUS NEXT
Tagged: #send #html #file #show #Browser
ADD COMMENT
Topic
Name
9+2 =