4 changed files with 92 additions and 0 deletions
@ -0,0 +1,42 @@ |
|||
{ |
|||
"name": "04_npm", |
|||
"version": "3.2.1", |
|||
"lockfileVersion": 3, |
|||
"requires": true, |
|||
"packages": { |
|||
"": { |
|||
"name": "04_npm", |
|||
"version": "3.2.1", |
|||
"license": "ISC", |
|||
"dependencies": { |
|||
"formidable": "^1.2.2", |
|||
"upper-case": "^2.0.2" |
|||
} |
|||
}, |
|||
"node_modules/formidable": { |
|||
"version": "1.2.2", |
|||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", |
|||
"integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", |
|||
"deprecated": "Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau", |
|||
"license": "MIT", |
|||
"funding": { |
|||
"url": "https://ko-fi.com/tunnckoCore/commissions" |
|||
} |
|||
}, |
|||
"node_modules/tslib": { |
|||
"version": "2.8.1", |
|||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", |
|||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", |
|||
"license": "0BSD" |
|||
}, |
|||
"node_modules/upper-case": { |
|||
"version": "2.0.2", |
|||
"resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", |
|||
"integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", |
|||
"license": "MIT", |
|||
"dependencies": { |
|||
"tslib": "^2.0.3" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
{ |
|||
"name": "04_npm", |
|||
"version": "3.2.1", |
|||
"description": "maly webserver se stazenymi knihovnami", |
|||
"keywords": [ |
|||
"node", |
|||
"npm", |
|||
"knihovny", |
|||
"test", |
|||
"wtl" |
|||
], |
|||
"license": "ISC", |
|||
"author": "skrabanek", |
|||
"type": "commonjs", |
|||
"main": "index.js", |
|||
"scripts": { |
|||
// pro spuštění odstranit komentáře ☺ |
|||
//npm run test <- spustí server na portu 25565 |
|||
"test": "node tester.js 25565", |
|||
//další možnost vytvoření rychlých přikazů na testování |
|||
//npm run prod |
|||
"prod": "node tester.js 80" |
|||
}, |
|||
"dependencies": { |
|||
"formidable": "^1.2.2", |
|||
"upper-case": "^2.0.2" |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
// nainstalujeme knihovny
|
|||
// npm install upper-case@2.0.2
|
|||
// npm i formidable@1.2.2
|
|||
|
|||
var http = require("http") |
|||
var uc = require("upper-case") |
|||
|
|||
var PORT = process.argv[2] || 8080; // AltGR + W = |
|
|||
|
|||
if(!process.argv[2]) { |
|||
console.log("nebyl určený port, používám 8080"); |
|||
} |
|||
|
|||
http.createServer(function (req,res){ |
|||
res.writeHead(200, {"content-type":"text/html"}) |
|||
res.write(uc.upperCase("hElLo wOrlD, mINEcraFt")); |
|||
res.end(); |
|||
}).listen(PORT); |
|||
|
|||
console.log("Server bezi na http://localhost:"+PORT) |
|||
|
|||
//npm run test
|
|||
Loading…
Reference in new issue