Open History to see the last commit
1// an simple endpoint for getting current list
2let list = ['Item 1', 'Item 2', 'Item 3']
3β
4export default async (req, res) => {
5 if (req.query.add) {
6 if (!list.includes(req.query.add)) {
7 list.push(req.query.add)
8 }
9 } else if (req.query.clear) {
10 list = []
11 }
12β
13 await new Promise(r => setTimeout(r, 100))
14β
15 res.json(list)
16}