Created
October 17, 2023 13:20
-
-
Save RahulBRB/5152f4203684f1bcafd7e181833271e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let http = require('http'); | |
let fs = require('fs'); | |
let port = 8772; | |
let server = http.createServer(function(req, res){ | |
fs.readFile('db.json','utf-8',function(err, data){ | |
if(err) throw err; | |
res.write(data); | |
res.end() | |
}) | |
}) | |
server.listen(port) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment