jaeyoung Lee
@wpdud1221
Reviews Written
-
Average Rating
-
Posts
Q&A
์๋ฐ์คํฌ๋ฆฝํธ(node.js)์ ์๋ฐ ์ค ๋ฐฑ์๋๋ฅผ ์ํด์ ์ด๋ ๊ฒ์ ์ฐ์ ์ ํ ์ง ๊ณ ๋ฏผ์ ๋๋ค.
๊ฒฝ๋ ฅ์ใ ์ธ๋ฐ ์ ์ ๋น์ทํ ๊ณ ๋ฏผ์ค์ด์๋ค์ ์ ๋ ์๋ฐ์คํฌ๋ฆฝํธ๊ฐ ์ปค์ง๋์๋๊ฐ ์ ์ ๋ ๋นจ๋ผ์ง๊ฑฐ๋ผ๊ณ ์๊ฐํด์ ๋ ธ๋๋ฅผ ๋ ์ด์ฌํ ๋ณด๊ณ ์์ต๋๋ค
- 0
- 2
- 8.6K
Q&A
๊ฐ์ฌ๋ ์ง๋ฌธ์ด์์ต๋๋ค.
๊ฐ์ฌ๋ ๋ค์ ์์ ๊ธฐ๋ฐ์ผ๋ก ํ๋ก ํธ + ๋ฐฑ์๋ ํฉ์ณ์ ํ ์ดํ๋ก์ ํธ ์งํ์ค์ ๋งํ๋์ ์ ์ง๋ฌธ ๋๋ ค๋๊ด์ฐฎ์๊น์? ๋ค๋ฆ์ด์๋๊ตฌ ์ ๊ฐ ์นด์นด์ค์์ ์ฌ์ฉํ๋ ์ขํ x, y ๋ฅผ ์ฌ์ฉํ๊ธฐ์ํด์ mysql db์ ์ ์ฅ๋ 400 ,500 ๊ฑด์ ๋ row๋ฅผ ์กฐํํ x, y๋ง ๊ฐ์ ธ์์ ํ ์ด๋ธ์ ์ ๋ฐ์ดํธ ํด์ฃผ๋ ค๊ณ ํ๋๋ฐ ์ด ์์ฒญ์๋ณด๋ด๋ฉด 429 Too Many Requests ์ค๋ฅ๊ฐ๋จ๊ณ for๋ฌธ๋ ์ฒซ๋ฒ์งธ๋ ๋์์ ์ ๋ฐ์ดํธ๊ฐ ๋๊ธดํ๋๋ฐ ์ด์ ์ ํด๊ฒฐ๋ฐฉ๋ฒ์ด ์๋์? for(var i in noLocationList){ const option = { url: `https://dapi.kakao.com/v2/local/search/address.json?query=${encodeURI(noLocationList[i]['address'])}`, methods: 'GET', headers : { Authorization : 'KakaoAK 064940e08c54717d89d8728298c08b71' }, // query : noLocationList[0]['address'] } request(option, async (error,response) =>{ console.log("ํธ์ถ") console.log("์๋ฌ๋ด์ฉ",error); console.log(response); if(error) new Error('400'); // console.log("===========๋ช๋ฒ์จฐ๋ฆฌํ์คํธ???",i); var result = JSON.parse(response.body); // result.documents[0].x // result.documents[0].y // var jsonVal = xmlToJson(response.body); // console.log(jsonVal); await ApartmentPrice.update({ xlocation : result.documents[0].x , ylocation : result.documents[0].y }, {where : {id: noLocationList[i]['id']}}) }) }
- 0
- 4
- 342
Q&A
๊ฐ์ฌ๋ ์ง๋ฌธ์ด์์ต๋๋ค.
if(testVal[i]['as1']===undefined) {testVal[i]['as1']={_text:''} } ๊ฐ์ฒด ๊ฐ ๋น์์์ value๊ฐ ๋น๊ฐ์ ์ธํ ํด์ฃผ์ด์ ํด๋น๋ฌธ์ ํด๊ฒฐํ์ต๋๋ค.
- 0
- 4
- 342
Q&A
๊ฐ์ฌ๋ ์ง๋ฌธ์ด์์ต๋๋ค.
ํด๋น๋ฌธ์ ๋ JSON.parse(test)๋ก ํด๊ฒฐํ์ต๋๋ค. ๊ฐ์ฌ๋ ์ง๋ฌธ์ด์๋๋ฐ์ for(i in testVal){ // console.log(testVal[i]['kaptName']['_text']) // console.log(testVal[i]['as1']['_text']); // console.log(testVal[i]['as2']['_text']); // console.log(testVal[i]['as3']['_text']); // console.log(testVal[i].as4._text); Apartment.create({ kaptName: testVal[i]['kaptName']['_text'], as1 : testVal[i]['as1']['_text'], // as2 : testVal[i]['as2']['_text'], as3 : testVal[i]['as3']['_text'], // as4 : testVal[i]['as4']['_text'] || '', }); ํ์ฌ testVal[i].as4๊ฐ required๊ฐ false๋ผ์ ๋น๊ฐ์ด ์ฌ์๋์๋๋ฐ ์ด๋ฐ๊ฒ ์ค๋ฅ๊ฐ ์๋๊ฒํ๋ ค๋ฉด ์ด๋ป๊ฒ ์ฒ๋ฆฌํด์ค์ผํ๋์? ๊ทธ๋ฆฌ๊ณ ์ฌ๋ฌ๊ฐ์ง ๋ฌธ ์ํ๋ผ์ด์ฆ๋ promise.allsettled ํน์ promise.all์จ์ค์ผํ ๊น์?
- 0
- 4
- 342
Q&A
๋ก๊ทธ์ธ ์ด๋ ํ์๊ฐ์ api ์์ฒญ์
๋น๋๋ฌธ์ ์ธ๊ฐํด์ ๋ฆฌ๋น๋ํด์ ๋ค์ ์คํํธํ๋๋ฐ๋ ํด๋น๋ฌธ์ ๊ฐ ๊ณ์๋๋ค์
- 0
- 1
- 245
Q&A
๊ฒ์๋ฌผ์ด ๋ก๋๊ฐ ์ ๋๋๊ฒ ๊ฐ์์
์ ๋ async ๋ฌธ์ผ๋ก ๋ฐ๊พธ๋ ์๋๋ค์ hwd3527๋ ๊ฐ์ฌํฉ๋๋ค
- 0
- 6
- 388




