@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugin.js +9 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/admin",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "This project Softpro Admin",
5
5
  "main": "dist/admin.js",
6
6
  "type": "module",
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
- export default async function (fastify, opts) {
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'), config);
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'), config);
18
- fastify.register(import('./server/routes/menu/index.mjs'), config);
19
- fastify.register(import('./server/routes/data/index.mjs'), config);
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)