import HubStore from './../../store/hub.js' /** * handle hub * * * @author Björn Hase * @license hhttps://www.gnu.org/licenses/gpl-3.0.en.html GPL-3 * @link https://gitea.node001.net/HerrHase/tellme-bot.git * */ export default async function(fastify, opts) { /** * getting post getting allowed parser class and send over xmpp * * @param {object} request * @param {object} response * */ fastify.get('/', async function (request, reply) { const hubStore = new HubStore() const results = await hubStore.find() reply .code(200) .send({ 'data': results }) }) /** * getting post getting allowed parser class and send over xmpp * * @param {object} request * @param {object} response * */ fastify.get('/:hubId', async function (request, reply) { reply .code(200) .send() }) /** * getting post getting allowed parser class and send over xmpp * * @param {object} request * @param {object} response * */ fastify.post('/', async function (request, reply) { const hubStore = new HubStore() // const hub = await hubStore.create(request.body) reply .code(200) .send({ 'data': hub }) }) /** * getting post getting allowed parser class and send over xmpp * * @param {object} request * @param {object} response * */ fastify.put('/:hubId', async function (request, reply) { reply .code(200) .send() }) /** * getting post getting allowed parser class and send over xmpp * * @param {object} request * @param {object} response * */ fastify.delete('/:hubId', async function (request, reply) { reply .code(200) .send() }) }