Page 179 - Nodejs 교과서 개정2판
P. 179
IUUQT৬ IUUQ
IUUQT ݽٕ ਢ ࢲߡী 44- ঐഐചܳ ୶оפ (&5ա 1045 ਃਸ ೡ ٸ য়оח ؘఠܳ ঐഐച೧ࢲ
рী ܲ ࢎۈ ਃਸ о۽؊ۄب ղਊਸ ഛੋೡ ࣻ হѱ פ ਃ્ ۽Ӓੋա Ѿઁо ਃೠ ହী
ࢲ IUUQT ਊ ࣻо غח ୶ࣁੑפ
44- ਊػ ਢ ࢎী ߑޙೞݶ Ӓܿ җ э ࠳ۄ ࣗହী ޛ࣭ दо ա২פ
§ Ӓܿ IUUQT ਊ ചݶ
ী ա৳؍ IUUQ ࢲߡ ٘ੑפ
server1.js
const http = require('http');
http.createServer((req, res) => {
res.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });
res.write('<h1>Hello Node!</h1>');
res.end('<p>Hello Server!</p>');
})
.listen(8080, () => { // 서버 연결
console.log('8080번 포트에서 서버 대기 중입니다!');
});
ࢲߡী ঐഐചܳ ਊೞ۰ݶ IUUQT ݽٕਸ ࢎਊ೧ঠ פ ೞ݅ IUUQTח ইޖա ࢎਊೡ ࣻ ח Ѫ ই
תפ ঐഐചܳ ਊೞח ݅ఀ ӒѪਸ ੋૐ೧ ࣻ ח ӝҙب ਃפ ੋૐࢲח ੋૐ ӝҙীࢲ ҳੑ೧
ঠ ೞݴ -FUsT &ODSZQU э ӝҙীࢲ ޖܐ۽ ߊә೧ӝب פ
ੋૐࢲ ߊә җ ࠂೞҊ بݫੋب ਃೞ۽ ੋૐࢲܳ ߊә߉ח ߑߨ ଼ীࢲ ࣗѐೞ ঋѷणפ
ߊә߉ ੋૐࢲо ݶ җ э ೞݶ ؾפ
server1-3.js
const https = require('https');