๋ฐ์ํ node.js49 [Node.js-์ํ์ฝ๋ฉ] App ์ ์ - ํจ์๋ฅผ ์ด์ฉํด์ ์ ๋ฆฌ ์ ๋ํ๊ธฐ [์ถ์ฒ-Youtube ์ํ์ฝ๋ฉ] https://www.youtube.com/watch?v=TtVxkScVmUc&list=PLuHgQVnccGMA9QQX5wqj6ThK7t2tsGxjm&index=34 main.js var http = require('http'); var fs = require('fs'); var url = require('url'); function templateHTML(title, list, body){ return ` WEB ${list} ${body} `; } function templateList(filelist){ var list = ''; var i = 0; while(i < filelist.length){ list = list + `${filelist[i]}`; i = i .. 2021. 1. 28. [Node.js-์ํ์ฝ๋ฉ] JavaScript - ํจ์์ ์ถ๋ ฅ [์ถ์ฒ-Youtube ์ํ์ฝ๋ฉ] https://www.youtube.com/watch?v=OXGGA-rh__0&list=PLuHgQVnccGMA9QQX5wqj6ThK7t2tsGxjm&index=33 syntax/function2.js console.log(Math.round(1.6)); // 2 console.log(Math.round(1.4)); // 1 function sum(first, second){ return first+second; } console.log(sum(2,4)); return์ ๋ง๋๋ฉด ์ถ๋ ฅ ํ ํจ์๋ ์ฆ์ ์ข ๋ฃ๋๋ค. 2021. 1. 28. [Node.js-์ํ์ฝ๋ฉ] JavaScript - ํจ์์ ์ ๋ ฅ [์ถ์ฒ-Youtube ์ํ์ฝ๋ฉ] https://www.youtube.com/watch?v=c3Pail1Iitc&list=PLuHgQVnccGMA9QQX5wqj6ThK7t2tsGxjm&index=32 syntax/function2.js console.log(Math.round(1.6)); // 2 console.log(Math.round(1.4)); // 1 function sum(first, second){ // ์ ์ console.log(first+second); } sum(2,4); // ํธ์ถ ์ ์, ์ ์ธ, ํธ์ถ ๊ฐ๋ ํ์คํ ์์๋ ๊ฒ ํธ์ถ์ ๋จผ์ ํ๊ณ ์ ์๋ ์ ์ธ์ ํ๋๊ฒ ๋ ผ๋ฆฌ์ ์ผ๋ก ๋ง๋ค. (์ ์ฝ๋๋ ์ ์ ๋จผ์ ํ๊ณ ํธ์ถํจ) 2021. 1. 28. [Node.js-์ํ์ฝ๋ฉ] JavaScript - ํจ์์ ๊ธฐ๋ณธ ๋ฌธ๋ฒ [์ถ์ฒ-Youtube ์ํ์ฝ๋ฉ] https://www.youtube.com/watch?v=XDS4cp6Gg5w&list=PLuHgQVnccGMA9QQX5wqj6ThK7t2tsGxjm&index=31 syntax/function.js f123(); console.log('A'); console.log('Z'); console.log('B'); f123(); console.log('F'); console.log('C'); console.log('P'); console.log('J'); f123(); console.log('U'); console.log('A'); console.log('Z'); console.log('J'); console.log('I'); f123(); function f123(){ con.. 2021. 1. 28. [Node.js-์ํ์ฝ๋ฉ] App ์ ์ - ๊ธ๋ชฉ๋ก ์ถ๋ ฅํ๊ธฐ [์ถ์ฒ-Youtube ์ํ์ฝ๋ฉ] https://www.youtube.com/watch?v=ibz2gaW-tyQ&list=PLuHgQVnccGMA9QQX5wqj6ThK7t2tsGxjm&index=30 main.js var http = require('http'); var fs = require('fs'); var url = require('url'); var app = http.createServer(function(request,response){ var _url = request.url; var queryData = url.parse(_url, true).query; var pathname = url.parse(_url, true).pathname; if(pathname === '/'){ if(quer.. 2021. 1. 27. [Node.js-์ํ์ฝ๋ฉ] Node.js์์ ํ์ผ๋ชฉ๋ก ์์๋ด๊ธฐ [์ถ์ฒ-Youtube ์ํ์ฝ๋ฉ] https://www.youtube.com/watch?v=tzJ2K3Yp89I&list=PLuHgQVnccGMA9QQX5wqj6ThK7t2tsGxjm&index=29 nodejs/readdir.js var testFolder = './data'; var fs = require('fs'); fs.readdir(testFolder, function(error, filelist){ console.log(filelist); }) 2021. 1. 27. ์ด์ 1 2 3 4 5 6 7 8 9 ๋ค์ ๋ฐ์ํ