page cw
This commit is contained in:
30
app.js
Normal file
30
app.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict'
|
||||
|
||||
const path = require('node:path')
|
||||
const AutoLoad = require('@fastify/autoload')
|
||||
|
||||
// Pass --options via CLI arguments in command to enable these options.
|
||||
const options = {}
|
||||
|
||||
module.exports = async function (fastify, opts) {
|
||||
// Place here your custom code!
|
||||
|
||||
// Do not touch the following lines
|
||||
|
||||
// This loads all plugins defined in plugins
|
||||
// those should be support plugins that are reused
|
||||
// through your application
|
||||
fastify.register(AutoLoad, {
|
||||
dir: path.join(__dirname, 'plugins'),
|
||||
options: Object.assign({}, opts)
|
||||
})
|
||||
|
||||
// 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)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports.options = options
|
||||
Reference in New Issue
Block a user