How to read file in NodeJS ?
to access file in NodeJS we need file System module (fs) example: require(‘fs’)
const http = require('http'); const fs = require("fs"); http.createServer(function (req, res, next) { fs.readFile('index.html',(err, data) => { res.write(data); return res.end(); }) }).listen('8080')
Quick Links
Legal Stuff