Skip to content

Commit

Permalink
Restore ATC sectors API
Browse files Browse the repository at this point in the history
  • Loading branch information
Kahn committed Apr 16, 2022
1 parent c54afa2 commit 7a55d2d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,21 @@ app.get('/v1/flights/departures/:icaoCode', cors(), async (req, res) => {
}
});

app.get('/v1/atc/sectors', cors(), async (req, res) => {
var standardOnly = (req.query.standardOnly == undefined ? false : req.query.standardOnly.toString());
var sectors = await getATCSectors();
if (standardOnly == "true"){
sectors = sectors.filter(function(sector) {
return sector.standard_position===true;
});
}
if(sectors == false){
res.sendStatus(500);
}else{
res.send(sectors)
}
});

app.get('/v1/atc/online', cors(), async (req, res) => {
var sectors = await getOnlinePositions();
if(sectors == false){
Expand Down

0 comments on commit 7a55d2d

Please sign in to comment.