1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
app.get('/api/v1/killBill', async (_req: Request, res:
Response) => {
try {
const randomQuote = killBillQuotes [Math.floor
(Math.random() * killBillQuotes.length)];
res.status(200).send({
success: true,
data: {
quote: randomQuote
}
});
} catch (error) {
res.send(500).send('An unexpected error ocurred');
}
});
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
app.get('/api/v1/killBill',
async (_req: Request,
res:
Response) => {
try {
const randomQuote =
killBillQuotes
[Math.floor
(Math.random() *
killBillQuotes
.length)];
res.status(200)
.send({
success: true,
data: {
quote:
randomQuote
}
});
} catch (error) {
res.send(500)
.send('An unexpected
error ocurred');
}
});