Skip to content

Commit 098f1c6

Browse files
committed
added endpoint to sort launches by ASDS landings
1 parent f6bbb87 commit 098f1c6

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
@@ -80,4 +80,16 @@ v1.get("/caps/:cap", (req, res) => {
8080
})
8181
})
8282

83+
// Returns all ASDS launches
84+
v1.get("/asds", (req, res) => {
85+
global.db.collection("launch").find({"landing_type": "ASDS"},{"_id": 0}).sort({"flight_number": 1})
86+
.toArray((err, doc) => {
87+
if (err) return console.log(err)
88+
if (doc.length == 0) {
89+
res.end(JSON.stringify(error, null, 2))
90+
}
91+
res.end(JSON.stringify(doc, null, 2))
92+
})
93+
})
94+
8395
module.exports = v1

0 commit comments

Comments
 (0)