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
/
route-parameters
/
routes
/
pages
/
routes.mjs
10 lines
(8 loc)
•
263 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
export
default
async
function
(
app, opts
) { app.
get
(
'/'
,
async
function
(
req, reply
) {
return
{
route
:
'/pages'
} }) app.
get
(
'/archived'
,
async
function
(
req, reply
) {
return
{
route
:
'/pages/archived'
,
id
: req.
params
.
id
}
// should be null
}) }