You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
727 B

import HubStore from './../store/hub.js'
/**
*
* @author Björn Hase, <me@herr-hase.wtf>
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.node001.net/HerrHase/filehub
*
*/
export default async function(fastify, opts) {
/**
* get single hub
*
* @param {object} request
* @param {object} response
*
*/
fastify.get('/:id([-a-zA-Z0-9]{0,255})', async (request, response) => {
// create store
const hubStore = new HubStore()
// getting single
const result = await hubStore.findOneById(request.params.id)
return response.view('../frontend/views/hub', {
'data': result
})
})
}