OneCompiler

6c

236

exports.authenticateUser = (a, b) => {
return a+b;
};
main.js :
const http = require("http");
var dbmodule = require("./6c1");
var server = http.createServer((request, response) => {
result = dbmodule.authenticateUser(3000,2);
response.writeHead(200, { "Content-Type": "text/html" });
response.end("<html><body><h1>" + result + "

  • You have connected to the
    localhost 3002 </h1></body></html>");
    console.log("Request received");
    });
    server.listen(3002);
    console.log("Server is running at port 3002");