박찬수

commit

......@@ -28,7 +28,7 @@ app.post('/hook', function (req, res) {
console.log('[request message]', eventObj.message);
console.log("Receive Message : ", eventObj.message.text);
//console.log(soccer.GetPlayerInfo(276, 2019));
console.log(soccer.GetPlayerInfo(276, 2019));
request.post(
{
......
......@@ -15,10 +15,9 @@ request(options, function (error, response) {
console.log(response.body);
});
module.exports = function(){
this.GetPlayerInfo = function(playerID, season){
module.exports = {
GetPlayerInfo : function(playerID, season){
var request = require('request');
var options = {
method: 'GET',
url: 'https://v3.football.api-sports.io/players',
......@@ -28,12 +27,9 @@ module.exports = function(){
'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
return response.body;
});
}
}
\ No newline at end of file
......