Skip to content

Commit 42cea06

Browse files
committed
added endpoint to sort launches by RTLS landings
1 parent 098f1c6 commit 42cea06

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

routes/v1-launches.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,16 @@ v1.get("/asds", (req, res) => {
9292
})
9393
})
9494

95+
// Returns all RTLS launches
96+
v1.get("/rtls", (req, res) => {
97+
global.db.collection("launch").find({"landing_type": "RTLS"},{"_id": 0}).sort({"flight_number": 1})
98+
.toArray((err, doc) => {
99+
if (err) return console.log(err)
100+
if (doc.length == 0) {
101+
res.end(JSON.stringify(error, null, 2))
102+
}
103+
res.end(JSON.stringify(doc, null, 2))
104+
})
105+
})
106+
95107
module.exports = v1

0 commit comments

Comments
 (0)