Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you have to install "npm install exports"
// put into app.js
var http = require('http');
var dt = require('./module');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(dt.mytext());
res.end();
}).listen(3000);
console.log("Listening to Port 3000");
// put into module.js
exports.mytext = function () {
var text = "HELLO WORLD!"
return text.toLowerCase();
};
// type "node app.js" in command prompt
// then put this url "http://localhost:3000/" into any browser
The most helpful NODEJS solutions