Skip to content

Commit

Permalink
Add inital endpoint for falcon heavy roadster data
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewmeyer committed Jul 13, 2018
1 parent f87613c commit 0cce078
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/controllers/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,16 @@ module.exports = {
ctx.body = data[0];
},

/**
* Returns company info
*/
roadster: async (ctx) => {
const data = await global.db
.collection('info')
.find({ name: "Elon Musk's Tesla Roadster" })
.project({ _id: 0 })
.toArray();
ctx.body = data[0];
},

};
1 change: 1 addition & 0 deletions src/routes/v2-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const v2 = new Router({

// Returns company info
v2.get('/', info.get);
v2.get('/roadster', info.roadster);
v2.get('/history', history.all);

module.exports = v2;

0 comments on commit 0cce078

Please sign in to comment.