@opengis/admin 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugin.js +9 -5
package/package.json
CHANGED
package/plugin.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import fp from 'fastify-plugin';
|
|
1
2
|
import config from './config.js';
|
|
2
3
|
config.prefix = config.prefix || '/api'
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
async function plugin(fastify, opts = config) {
|
|
4
7
|
// const prefix = config.prefix || '/api';
|
|
5
8
|
|
|
6
9
|
// core
|
|
7
10
|
|
|
8
11
|
|
|
9
|
-
fastify.register(import('./server/helpers/index.mjs'),
|
|
12
|
+
fastify.register(import('./server/helpers/index.mjs'), opts);
|
|
10
13
|
// fastify.register(import('@opengis/fastify-auth'), config);
|
|
11
14
|
|
|
12
15
|
// fastify.register(import('./server/plugins/vike.js'));
|
|
@@ -14,8 +17,9 @@ export default async function (fastify, opts) {
|
|
|
14
17
|
|
|
15
18
|
// API
|
|
16
19
|
|
|
17
|
-
fastify.register(import('./server/routes/templates/index.mjs'),
|
|
18
|
-
fastify.register(import('./server/routes/menu/index.mjs'),
|
|
19
|
-
fastify.register(import('./server/routes/data/index.mjs'),
|
|
20
|
+
fastify.register(import('./server/routes/templates/index.mjs'), opts);
|
|
21
|
+
fastify.register(import('./server/routes/menu/index.mjs'), opts);
|
|
22
|
+
fastify.register(import('./server/routes/data/index.mjs'), opts);
|
|
20
23
|
|
|
21
24
|
}
|
|
25
|
+
export default fp(plugin)
|