|
|
@ -17,10 +17,10 @@ export default async function(fastify, opts) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* prehandler for all routes
|
|
|
|
* prehandler for all routes
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param {[type]} request
|
|
|
|
* @param {Object} request
|
|
|
|
* @param {[type]} reponse
|
|
|
|
* @param {Object} reponse
|
|
|
|
* @param {Function} done
|
|
|
|
* @param {Function} done
|
|
|
|
* @return {[type]}
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
fastify.addHook('preHandler', async function(request, response) {
|
|
|
|
fastify.addHook('preHandler', async function(request, response) {
|
|
|
|
|
|
|
|
|
|
|
@ -35,8 +35,8 @@ export default async function(fastify, opts) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* handle single post
|
|
|
|
* handle single post
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param {object} request
|
|
|
|
* @param {Object} request
|
|
|
|
* @param {object} response
|
|
|
|
* @param {Object} response
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
fastify.get('/:slug([-a-zA-Z0-9]{0,255})', async function(request, response) {
|
|
|
|
fastify.get('/:slug([-a-zA-Z0-9]{0,255})', async function(request, response) {
|
|
|
|