Page 219 - Nodejs 교과서 개정2판
P. 219
TUBUJD
TUBUJD ٜਝযח ੋ ੌٜਸ ઁҕೞח ۄఠ ೡਸ פ ӝࠄਵ۽ ઁҕغӝী ٮ۽ ࢸೡ ਃ
হ express ё উীࢲ ԁղ ೞݶ ؾפ җ э ࢎਊפ
app.use('요청 경로', express.static('실제 경로'));
app.use('/', express.static(path.join(__dirname, 'public')));
ೣࣻ ੋࣻ۽ ੌٜ ѹ ח ಫ؊ܳ ೞݶ ؾפ അ QVCMJD ಫ؊о غয णפ ܳ
ٜয QVCMJD TUZMFTIFFUT TUZMF DTTח IUUQ MPDBMIPTU TUZMFTIFFUT TUZMF DTT۽ Ӕೡ ࣻ णפ Q
VCMJD ಫ؊ܳ ٜ݅Ҋ DTTա KT ੌٜਸ QVCMJD ಫ؊ী ֍ਵݶ ࠳ۄীࢲ Ӕೡ ࣻ ѱ ؾפ
पઁ ࢲߡ ಫ؊ ҃۽ীח QVCMJD ٜয ݅ ਃ ࣗীח QVCMJD ٜয ঋח ਸ ݾ೧ࣁ
ਃ ࢲߡ ಫ؊ ҃۽৬ ਃ ҃۽о ܰ۽ ৻ࠗੋ ࢲߡ ҳઑܳ औѱ ঈೡ ࣻ হणפ ח ࠁউী
ب ؾפ
ژೠ ੌٜਸ ঌইࢲ ઁҕ೧۽ ۢ fs.readFile۽ ੌਸ ੍যࢲ ࣠ೡ ਃо হणפ
݅ড ਃ ҃۽ী ೧ೞח ੌ হਵݶ ঌইࢲ ղࠗਵ۽ nextܳ ഐפ ݅ড ੌਸ ߊѼ೮ݶ
ٜਝযח प೯غ ঋणפ ਵ۽ ੌਸ ࠁղҊ nextܳ ഐೞ ঋਵפөਃ
CPEZ QBSTFS
ਃ ࠄޙী ח ؘఠܳ ೧ࢳ೧ࢲ SFR CPEZ ё۽ ٜ݅যח ٜਝযੑפ ࠁా ಬ ؘఠա "+"9
ਃ ؘఠܳ ܻפ ױ ݣ౭ ز࢚ ੌ ؘఠח ܻೞ ޅפ Ӓ ҃ীח ٍ
ী աয়ח NVMUFS ݽٕਸ ࢎਊೞݶ ؾפ
CPEZ QBSTFS ٜਝযח җ э ࢎਊפ
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
ܲ ଼ա ٘ীࢲ CPEZ QBSTFSܳ ࢸೞח Ѫਸ ࠅ ࣻب णפ ೞ݅ झۨझ ߡࠗఠ C
PEZ QBSTFS ٜਝয ੌࠗ ӝמ झۨझী ղغਵ۽ ٮ۽ ࢸೡ ਃо হणפ
ױ CPEZ QBSTFSܳ ࢸ೧ঠ ೞח ҃ب णפ CPEZ QBSTFSח +40/җ 63- FODPEFE ഋध ؘ
ఠ ৻ীب 3BX 5FYU ഋध ؘఠܳ ୶о۽ ೧ࢳೡ ࣻ णפ
3BXח ਃ ࠄޙ ߡಌ ؘఠੌ ٸ 5FYUח ఫझ ؘఠੌ ٸ ೧ࢳೞח ٜਝযੑפ ߡಌա ఫझ