You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
516 B
20 lines
516 B
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/
|