Skip to content

Commit

Permalink
v0.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbam committed Sep 2, 2019
1 parent 42b9d78 commit 78bb42e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.x
v0.1.x
19 changes: 17 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
})
});

Expand All @@ -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),
});
})
});
Expand Down
Binary file added static/dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 78bb42e

Please sign in to comment.