Page 70 - Nodejs 교과서 개정2판
P. 70
۠ূ٘ ߄झ݀
ীࢲח ଼ী աয়ח ઁٜ ۠ূ٘ী ࢎਊغח ӝמٜਸ ࢸݺפ )5.-ীࢲ script కӒ উ
ী ࢿೞח ࠗ࠙ੑפ ଼ীࢲח ۠ূ٘ܳ Өѱ ܖ ঋणפ ೞ݅ ઁ ٘ ೧ܳ ذӝ ਤ
೧ ݻ оܳ ࣗѐפ
"+"9
"+"9 "TZODISPOPVT +BWBTDSJQU "OE 9.- ח ࠺زӝ ਢ ࢲ࠺झܳ ѐߊೡ ٸ ࢎਊೞח ӝߨੑפ ܴী 9.-
ٜয ݅ ԙ 9.-ਸ ࢎਊ೧ঠ ೞח Ѫ ইפݴ ਃ્ীח +40/ਸ ݆ ࢎਊפ औѱ ݈೧ ಕ
ز হ ࢲߡী ਃਸ ࠁղҊ ਸ ߉ח ӝࣿੑפ ਃҗ ী ࢸݺغয णפ ਢ ࢎ
ীࢲ ಕ ജ হ ࢜۽ ؘఠܳ ࠛ۞য়ח ࢎח ࠗ࠙ "+"9 ӝࣿਸ ࢎਊೞҊ Ҋ ࠁݶ ؾפ
ࠁా "+"9 ਃ K2VFSZա BYJPT э ۄ࠳۞ܻܳ ਊ೧ࢲ ࠁշפ ࠳ۄীࢲ ӝࠄਵ۽ XMLHttpR
equest ёܳ ઁҕೞӟ ೞ݅ ࢎਊ ߑߨ ࠂೞҊ ࢲߡীࢲח ࢎਊೡ ࣻ হਵ۽ ଼ীࢲח ߈ਵ۽
BYJPTܳ ࢎਊೞѷणפ
۠ূ٘ীࢲ ࢎਊೞ۰ݶ )5.- ੌਸ ೞա ٜ݅Ҋ Ӓ উী script కӒܳ ୶о೧ঠ פ ف ߣ૩ scrip
t కӒ উী খਵ۽ աয়ח ۠ূ٘ ઁ ٘ܳ ֍ਵݶ ؾפ
front.html
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
// 여기에 예제 코드를 넣으세요.
</script>
ݢ ਃ ೠ ઙܨੋ (&5 ਃਸ ࠁղѷणפ ਃ ઙܨח ীࢲ 3&45 "1*ܳ ܖݴ ಝࠇפ
axios.get ೣࣻ ੋࣻ۽ ਃਸ ࠁյ ࣗܳ ֍ਵݶ ؾפ
axios.get('https://www.zerocho.com/api/get')
.then((result) => {
console.log(result);
console.log(result.data); // {}
})
.catch((error) => {
console.error(error);
});