emilsoftware-utilities 1.3.78 → 1.3.80
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Application } from "express";
|
|
2
|
-
export
|
|
2
|
+
export declare function initializeAccessiModule(app: Application, options: any): Promise<void>;
|
|
3
3
|
export { AccessiModule } from "./AccessiModule";
|
|
4
|
+
export { StatoRegistrazione } from "./models/StatoRegistrazione";
|
|
4
5
|
export { ILoginResult } from "./Services/AuthService/IAuthService";
|
|
5
|
-
export declare function initializeAccessiModule(app: Application, options: any): Promise<void>;
|
|
@@ -8,41 +8,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
12
|
+
exports.StatoRegistrazione = exports.AccessiModule = void 0;
|
|
16
13
|
exports.initializeAccessiModule = initializeAccessiModule;
|
|
17
|
-
const AccessiModule_1 = require("./AccessiModule");
|
|
18
|
-
const express_1 = __importDefault(require("express"));
|
|
19
14
|
const core_1 = require("@nestjs/core");
|
|
20
15
|
const platform_express_1 = require("@nestjs/platform-express");
|
|
21
16
|
const SwaggerConfig_1 = require("./swagger/SwaggerConfig");
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(exports, "StatoRegistrazione", { enumerable: true, get: function () { return StatoRegistrazione_1.StatoRegistrazione; } });
|
|
24
|
-
var AccessiModule_2 = require("./AccessiModule");
|
|
25
|
-
Object.defineProperty(exports, "AccessiModule", { enumerable: true, get: function () { return AccessiModule_2.AccessiModule; } });
|
|
17
|
+
const AccessiModule_1 = require("./AccessiModule");
|
|
26
18
|
function initializeAccessiModule(app, options) {
|
|
27
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
20
|
try {
|
|
29
|
-
|
|
30
|
-
const expressAdapter = new platform_express_1.ExpressAdapter(
|
|
31
|
-
|
|
21
|
+
// ATTACCA NestJS DIRETTAMENTE ALLA TUA `app` EXPRESS ESISTENTE
|
|
22
|
+
const expressAdapter = new platform_express_1.ExpressAdapter(app);
|
|
23
|
+
// Crea un'istanza NestJS usando l'Express esistente
|
|
24
|
+
const nestApp = yield core_1.NestFactory.create(AccessiModule_1.AccessiModule.forRoot(options), expressAdapter, {
|
|
25
|
+
bufferLogs: true
|
|
26
|
+
});
|
|
32
27
|
nestApp.enableCors();
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
// Serviamo Swagger
|
|
28
|
+
nestApp.setGlobalPrefix('api/accessi'); // Assicura che tutte le API di NestJS vadano sotto `/api/accessi`
|
|
29
|
+
yield nestApp.init(); // ATTACCA NESTJS DIRETTAMENTE AD EXPRESS!
|
|
30
|
+
// Serviamo Swagger (ora sarà visibile su `/swagger/accessi`)
|
|
37
31
|
(0, SwaggerConfig_1.serveSwaggerDocs)(nestApp);
|
|
38
|
-
|
|
39
|
-
console.log('NestJS Routes:', nestApp.getHttpServer()._events.request._router.stack
|
|
40
|
-
.map((r) => { var _a; return (_a = r.route) === null || _a === void 0 ? void 0 : _a.path; })
|
|
41
|
-
.filter(Boolean));
|
|
32
|
+
console.log('NestJS AccessiModule inizializzato e attaccato a Express!');
|
|
42
33
|
}
|
|
43
34
|
catch (error) {
|
|
44
|
-
console.error("
|
|
45
|
-
throw error;
|
|
35
|
+
console.error("Errore in initializeAccessiModule:", error);
|
|
36
|
+
throw error;
|
|
46
37
|
}
|
|
47
38
|
});
|
|
48
39
|
}
|
|
40
|
+
var AccessiModule_2 = require("./AccessiModule");
|
|
41
|
+
Object.defineProperty(exports, "AccessiModule", { enumerable: true, get: function () { return AccessiModule_2.AccessiModule; } });
|
|
42
|
+
var StatoRegistrazione_1 = require("./models/StatoRegistrazione");
|
|
43
|
+
Object.defineProperty(exports, "StatoRegistrazione", { enumerable: true, get: function () { return StatoRegistrazione_1.StatoRegistrazione; } });
|