emilsoftware-utilities 1.3.76 → 1.3.77
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.
|
@@ -25,19 +25,21 @@ var AccessiModule_2 = require("./AccessiModule");
|
|
|
25
25
|
Object.defineProperty(exports, "AccessiModule", { enumerable: true, get: function () { return AccessiModule_2.AccessiModule; } });
|
|
26
26
|
function initializeAccessiModule(app, options) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
|
|
29
|
-
const nestExpressInstance = (0, express_1.default)();
|
|
30
|
-
// Creiamo un ExpressAdapter basato sulla nuova istanza
|
|
28
|
+
const nestExpressInstance = (0, express_1.default)(); // Istanza separata di Express per NestJS
|
|
31
29
|
const expressAdapter = new platform_express_1.ExpressAdapter(nestExpressInstance);
|
|
32
|
-
// Creiamo
|
|
30
|
+
// Creiamo l'app NestJS con l'adapter corretto
|
|
33
31
|
const nestApp = yield core_1.NestFactory.create(AccessiModule_1.AccessiModule.forRoot(options), expressAdapter, { bufferLogs: true });
|
|
34
|
-
// Abilitiamo CORS
|
|
32
|
+
// Abilitiamo CORS per evitare problemi con richieste da browser
|
|
35
33
|
nestApp.enableCors();
|
|
36
|
-
//
|
|
34
|
+
// Inizializziamo NestJS
|
|
37
35
|
yield nestApp.init();
|
|
38
|
-
//
|
|
36
|
+
// 🛠️ Importante: Usa `nestExpressInstance` per montare le API su /api/accessi
|
|
39
37
|
app.use('/api/accessi', nestExpressInstance);
|
|
40
38
|
// Serviamo Swagger
|
|
41
39
|
(0, SwaggerConfig_1.serveSwaggerDocs)(nestApp);
|
|
40
|
+
// Debug: Verifica se le rotte di NestJS sono registrate
|
|
41
|
+
console.log('NestJS Routes:', nestApp.getHttpServer()._events.request._router.stack
|
|
42
|
+
.map((r) => { var _a; return (_a = r.route) === null || _a === void 0 ? void 0 : _a.path; })
|
|
43
|
+
.filter(Boolean));
|
|
42
44
|
});
|
|
43
45
|
}
|