'use strict' const path = require('path') const AutoLoad = require('fastify-autoload') module.exports = async function (fastify, opts) { fastify.register(require('fastify-static'), { root: path.join(__dirname, 'public'), prefix: '/', // optional: default '/' }) // Place here your custom code! // Do not touch the following lines // This loads all plugins defined in routes // define your routes in one of these fastify.register(AutoLoad, { dir: path.join(__dirname, 'routes'), options: Object.assign({}, opts) }) }