JSFiddle - React, Tailwind, and code Playground
by Alain Armand
HTML
<div>
server.route([{
method: 'GET',
path: '/allitems',
config: {
handler: (request, reply) => {
const testData = db.collection('restaurants');
reply(testData.find({}, {
name: 1
}).toArray()); //filter only with ID + TITLE
},
cors: true
},
}]);
</div>