-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
47 lines (38 loc) · 943 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Recruiting exercise for Full-Stack Developer position at LOFINO GmbH
*/
const db = require("./db.json");
/*
Returns the number of cocktails in the database
*/
const drinksCount = () => {
return Promise.resolve(db.drinks.length);
};
/*
Returns all cocktails in the database
*/
const getAllDrinks = () => {
return Promise.resolve(db.drinks);
};
/*
Given an array of ingredients, e.g. ["Triple sec", "Sugar", "Lime Juice"],
return all cocktails in the database which I can make using these ingredients.
Below is the function signature for getMatchingDrinks. Please complete the function implementation.
*/
function getMatchingDrinks(ingredients) {
return Promise.resolve([
{
id: "11064",
name: "Banana Daiquiri",
ingredients: [
"Light rum",
"Triple sec",
"Banana",
"Lime juice",
"Sugar",
"Cherry"
]
}
]);
}
module.exports = getMatchingDrinks;