The options key allows you to pass a global options object to every plugin loaded by Autoload. Any option specified here will override plugin.autoConfig options defined within the individual plugins.
When using options.prefix alongside a plugin's autoPrefix, they are concatenated.
// In app.js
fastify.register(autoLoad, {
dir: path.join(__dirname, 'plugins'),
options: { prefix: '/defaultPrefix' }
})
// In /plugins/something.js
module.exports = function (fastify, opts, next) { /* ... */ }
module.exports.autoPrefix = '/something'
// Resulting route: /defaultPrefix/something