emilsoftware-utilities 1.3.81 โ†’ 1.3.82

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.
@@ -18,18 +18,35 @@ const AccessiModule_1 = require("./AccessiModule");
18
18
  function initializeAccessiModule(app, options) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
20
  try {
21
- const expressAdapter = new platform_express_1.ExpressAdapter(app); // ๐Ÿ”ฅ Usiamo la tua app Express esistente!
22
- const nestApp = yield core_1.NestFactory.create(AccessiModule_1.AccessiModule.forRoot(options), expressAdapter, {
21
+ // Creiamo un'istanza Express separata per NestJS
22
+ const nestExpressInstance = new platform_express_1.ExpressAdapter(app);
23
+ // Creiamo l'app NestJS attaccata a Express
24
+ const nestApp = yield core_1.NestFactory.create(AccessiModule_1.AccessiModule.forRoot(options), nestExpressInstance, {
23
25
  bufferLogs: true
24
26
  });
25
27
  nestApp.enableCors();
26
- nestApp.setGlobalPrefix('api/accessi'); // ๐Ÿ”ฅ Prefisso API per NestJS
27
- yield nestApp.init(); // ๐Ÿš€ Ora NestJS รจ attaccato a Express!
28
+ yield nestApp.init();
28
29
  (0, SwaggerConfig_1.serveSwaggerDocs)(nestApp);
29
- console.log('โœ… NestJS AccessiModule inizializzato con successo!');
30
+ console.log('Verifica API NestJS registrate:');
31
+ const expressInstance = nestApp.getHttpAdapter().getInstance();
32
+ const router = expressInstance.router;
33
+ const availableRoutes = router.stack
34
+ .map(layer => {
35
+ var _a, _b;
36
+ if (layer.route) {
37
+ return {
38
+ route: {
39
+ path: (_a = layer.route) === null || _a === void 0 ? void 0 : _a.path,
40
+ method: (_b = layer.route) === null || _b === void 0 ? void 0 : _b.stack[0].method,
41
+ },
42
+ };
43
+ }
44
+ })
45
+ .filter(item => item !== undefined);
46
+ console.log(availableRoutes);
30
47
  }
31
48
  catch (error) {
32
- console.error("โŒ Errore in initializeAccessiModule:", error);
49
+ console.error("Errore in initializeAccessiModule:", error);
33
50
  throw error;
34
51
  }
35
52
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emilsoftware-utilities",
3
- "version": "1.3.81",
3
+ "version": "1.3.82",
4
4
  "description": "Utilities for EmilSoftware",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",