API does not set the proper header

This commit is contained in:
wutno 2018-01-30 20:21:40 -05:00 committed by Matthew Little
parent de0b5eb1cd
commit d130958050

View File

@ -15,9 +15,11 @@ module.exports = function(logger, portalConfig, poolConfigs){
this.handleApiRequest = function(req, res, next){
switch(req.params.method){
case 'stats':
res.writeHead(200, { 'Content-Type: application/json' });
res.end(portalStats.statsString);
return;
case 'pool_stats':
res.writeHead(200, { 'Content-Type: application/json' });
res.end(JSON.stringify(portalStats.statPoolHistory));
return;
case 'live_stats':
@ -51,4 +53,4 @@ module.exports = function(logger, portalConfig, poolConfigs){
}
};
};
};