Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

data.js

13 lines291 Bytes

1// an simple endpoint for getting current list
2let list = ['Item 1', 'Item 2', 'Item 3']
3​
4export default (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 res.json(list)