권은령

update app.js

Showing 1 changed file with 2 additions and 1 deletions
...@@ -122,6 +122,8 @@ function handleEvent(event) ...@@ -122,6 +122,8 @@ function handleEvent(event)
122 { 122 {
123 // music list 출력 123 // music list 출력
124 return new Promise(function(resolve, reject){ 124 return new Promise(function(resolve, reject){
125 + var result = { type: 'text', text:''};
126 +
125 var url="https://www.genie.co.kr/chart/top200"; 127 var url="https://www.genie.co.kr/chart/top200";
126 128
127 request(url, function(error, response, html){ 129 request(url, function(error, response, html){
...@@ -146,7 +148,6 @@ function handleEvent(event) ...@@ -146,7 +148,6 @@ function handleEvent(event)
146 } 148 }
147 }); 149 });
148 150
149 - var result = { type: 'text', text:''};
150 for(var i=0; i<songList.length; i++) 151 for(var i=0; i<songList.length; i++)
151 { 152 {
152 result.text+=i+1 + ". "+ songList[i].singer+" - "+songList[i].song+"\n"; 153 result.text+=i+1 + ". "+ songList[i].singer+" - "+songList[i].song+"\n";
......