From 78bb42eed65349198df02556b82240402c619bdd Mon Sep 17 00:00:00 2001 From: nalbam Date: Mon, 2 Sep 2019 11:53:46 +0900 Subject: [PATCH] v0.1.x --- VERSION | 2 +- server.js | 19 +++++++++++++++++-- static/dot.png | Bin 0 -> 1053 bytes 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 static/dot.png diff --git a/VERSION b/VERSION index 8d73f66..11417f0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.0.x +v0.1.x diff --git a/server.js b/server.js index 62885b0..b874dd2 100644 --- a/server.js +++ b/server.js @@ -44,7 +44,16 @@ app.get('/times/:league', function (req, res) { } }; request(options, function (err, response, body) { - return res.status(200).json(JSON.parse(body)); + if (response.statusCode < 200 || response.statusCode > 299) { + return res.status(response.statusCode).json({ + result: false, + body: body, + }); + } + return res.status(200).json({ + result: true, + body: JSON.parse(body), + }); }) }); @@ -60,9 +69,15 @@ app.post('/times', function (req, res) { request.post(options, function (err, response, body) { console.log('times body res : ', body); + if (response.statusCode < 200 || response.statusCode > 299) { + return res.status(response.statusCode).json({ + result: false, + body: body, + }); + } return res.status(200).json({ result: true, - body: body, + body: JSON.parse(body), }); }) }); diff --git a/static/dot.png b/static/dot.png new file mode 100644 index 0000000000000000000000000000000000000000..a376c134570cc0d8a6b671d4eed50314177ca0f8 GIT binary patch literal 1053 zcmZ{j&u`N(6vtihLl87La48dqD4ZK7X~&3_Mq2KwA20r{ss6GI3w{#U?=GsLK`Kq{oeOu`#t-89UdKQDccGFV5@)VjYKQ^%7gpj z|IPaOT{I0gI@kj@Kc4>r0Wn-UkJ zuJ(!Z1VOl1Ec8WNr|Cy%+O`c13tCo7C|c}1=0Vnq*^6S5k7aO_%!X}1jVT4U2hhK)MA4yomA+H3RYe7s zaiDi8!6Lyjjjrjy|7>-Ak48y~8IyXW)K_hF{RlG}p2_Jy#Du$6iPX$>YO?aXyGy2O ztONc!plYlD@*q&2Dc>Uzj`LVd5zJag9qiGNrtgzrie;O(1G$U zSMGLEIJs3+j;n|hT~?v1{JHuSiNbu`_g;^i&!)%CdtcgjLE{26vX`AFvS$1HN8Zie G@#nwZD>%^r literal 0 HcmV?d00001