var http = require("http"); var uc = require("upper-case"); // npm install upper-case@2.0.2 <- ninstalovat knihovnu var PORT = process.argv[2] || 8080; if(!process.argv[2]) { console.log ("nebyl zadaný port, použije se výchozí 8080"); } http.createServer(function (req,res) { res.writeHead(200, {"content-type":"text/html"}); res.write(uc.upperCase("HeLLo WoRLd")); res.end(); }).listen(PORT); console.log("Server bezi na http://localhost:" + PORT); //npm run test //http://localhost:8080/