UNPKG
@fastify/autoload
Version:
latest (6.4.0)
next (6.0.0)
6.4.0
6.3.1
6.3.0
6.2.0
6.1.0
6.0.3
6.0.2
6.0.1
6.0.0
6.0.0-pre.fv5.1
5.10.0
5.9.0
5.8.3
5.8.2
5.8.1
5.8.0
5.7.2
5.7.1
5.7.0
5.6.0
5.5.0
5.4.1
5.4.0
5.3.1
5.3.0
5.2.0
5.1.0
5.0.0
4.0.1
4.0.0
Require all plugins in a directory
github.com/fastify/fastify-autoload
fastify/fastify-autoload
@fastify/autoload
/
test
/
module
/
dependency
/
plugins
/
plugin-g.js
17 lines
(12 loc)
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import
fp
from
'fastify-plugin'
function
plugin
(
f, opts, next
) { f.
get
(
'/plugin-g'
,
(
request, reply
) =>
{
const
data = request.
urlData
() reply.
send
(data) })
next
() }
export
default
fp
(plugin, {
name
:
'plugin-g'
,
dependencies
: [
'@fastify/url-data'
] })