opticore-webapp 1.0.32 → 1.0.34
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/dist/index.cjs
CHANGED
|
@@ -47,7 +47,7 @@ var import_module2 = require("module");
|
|
|
47
47
|
var import_cors = __toESM(require("cors"), 1);
|
|
48
48
|
var import_opticore_catch_exception_error4 = require("opticore-catch-exception-error");
|
|
49
49
|
var import_opticore_express2 = require("opticore-express");
|
|
50
|
-
var
|
|
50
|
+
var import_opticore_env_access4 = require("opticore-env-access");
|
|
51
51
|
var import_opticore_translator5 = require("opticore-translator");
|
|
52
52
|
|
|
53
53
|
// src/core/handlers/eventProcess.handler.ts
|
|
@@ -111,10 +111,10 @@ var import_chalk = __toESM(require("chalk"), 1);
|
|
|
111
111
|
var path2 = __toESM(require("path"), 1);
|
|
112
112
|
var fs = __toESM(require("fs"), 1);
|
|
113
113
|
var import_ansi_colors3 = __toESM(require("ansi-colors"), 1);
|
|
114
|
-
var
|
|
114
|
+
var import_opticore_http_response2 = require("opticore-http-response");
|
|
115
115
|
var import_opticore_translator3 = require("opticore-translator");
|
|
116
116
|
var import_opticore_env_access2 = require("opticore-env-access");
|
|
117
|
-
var
|
|
117
|
+
var import_opticore_logger2 = require("opticore-logger");
|
|
118
118
|
|
|
119
119
|
// src/core/helpers/modulesLoaded.utils.ts
|
|
120
120
|
var import_ansi_colors2 = __toESM(require("ansi-colors"), 1);
|
|
@@ -196,11 +196,30 @@ var loggerConfig = (envDir) => {
|
|
|
196
196
|
var import_path = __toESM(require("path"), 1);
|
|
197
197
|
var import_module = require("module");
|
|
198
198
|
var import_opticore_translator2 = require("opticore-translator");
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
|
|
200
|
+
// src/application/service/logger.service.ts
|
|
201
|
+
var import_opticore_logger = require("opticore-logger");
|
|
202
|
+
var SLogger = () => {
|
|
203
|
+
return new import_opticore_logger.LoggerCore();
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// src/core/config/loaders/translateLanguage.loader.ts
|
|
207
|
+
var import_opticore_http_response = require("opticore-http-response");
|
|
208
|
+
var translateWebAppCoreLanguageLoader = (localLang) => {
|
|
209
|
+
try {
|
|
210
|
+
const require2 = (0, import_module.createRequire)(importMetaUrl);
|
|
211
|
+
const packagePath = import_path.default.dirname(require2.resolve("opticore-webapp"));
|
|
212
|
+
const translateMsgJsonFilePath = import_path.default.join(packagePath, "utils", "translations");
|
|
213
|
+
import_opticore_translator2.TranslationLoader.loadTranslations(translateMsgJsonFilePath);
|
|
214
|
+
} catch (error) {
|
|
215
|
+
SLogger().error(
|
|
216
|
+
import_opticore_translator2.TranslationLoader.t(error.message, localLang),
|
|
217
|
+
import_opticore_translator2.TranslationLoader.t("readdir", localLang),
|
|
218
|
+
import_opticore_translator2.TranslationLoader.t("ENOENT:NoSuchFileOrDir", localLang),
|
|
219
|
+
error.stack,
|
|
220
|
+
import_opticore_http_response.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
221
|
+
);
|
|
222
|
+
}
|
|
204
223
|
};
|
|
205
224
|
|
|
206
225
|
// src/application/service/core.service.ts
|
|
@@ -209,10 +228,10 @@ var CoreService = class {
|
|
|
209
228
|
localLanguage;
|
|
210
229
|
environnementPath;
|
|
211
230
|
constructor(localLang, environnementPath) {
|
|
212
|
-
|
|
231
|
+
translateWebAppCoreLanguageLoader(localLang);
|
|
232
|
+
this.loggerConfig = new import_opticore_logger2.LoggerCore(loggerConfig(environnementPath));
|
|
213
233
|
this.environnementPath = environnementPath;
|
|
214
234
|
this.localLanguage = localLang;
|
|
215
|
-
translateWebAppCoreLanguageLoader();
|
|
216
235
|
}
|
|
217
236
|
/**
|
|
218
237
|
*
|
|
@@ -354,7 +373,7 @@ var CoreService = class {
|
|
|
354
373
|
const stackTrace = STraceError(
|
|
355
374
|
import_opticore_translator3.TranslationLoader.t("loadedModulesError", this.localLanguage),
|
|
356
375
|
import_opticore_translator3.TranslationLoader.t("loadedModules", this.localLanguage),
|
|
357
|
-
|
|
376
|
+
import_opticore_http_response2.HttpStatusCode.NOT_ACCEPTABLE,
|
|
358
377
|
true
|
|
359
378
|
);
|
|
360
379
|
throw new Error(stackTrace.message);
|
|
@@ -365,7 +384,7 @@ var CoreService = class {
|
|
|
365
384
|
// src/application/service/serverStartError.service.ts
|
|
366
385
|
var import_assert = __toESM(require("assert"), 1);
|
|
367
386
|
var import_opticore_catch_exception_error3 = require("opticore-catch-exception-error");
|
|
368
|
-
var
|
|
387
|
+
var import_opticore_http_response3 = require("opticore-http-response");
|
|
369
388
|
var import_opticore_translator4 = require("opticore-translator");
|
|
370
389
|
var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, internalErrors, logger, localLanguage) => {
|
|
371
390
|
switch (err.name) {
|
|
@@ -433,7 +452,7 @@ var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, int
|
|
|
433
452
|
const stackTrace = STraceError(
|
|
434
453
|
err.message,
|
|
435
454
|
err.name,
|
|
436
|
-
|
|
455
|
+
import_opticore_http_response3.HttpStatusCode.NOT_ACCEPTABLE,
|
|
437
456
|
true
|
|
438
457
|
);
|
|
439
458
|
err instanceof import_assert.default.AssertionError ? logger.error(
|
|
@@ -441,13 +460,13 @@ var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, int
|
|
|
441
460
|
"AssertionError",
|
|
442
461
|
stackTrace.name,
|
|
443
462
|
stackTrace.stack,
|
|
444
|
-
|
|
463
|
+
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
445
464
|
) : logger.error(
|
|
446
465
|
import_opticore_translator4.TranslationLoader.t(stackTrace.name, localLanguage),
|
|
447
466
|
"Another Error",
|
|
448
467
|
stackTrace.name,
|
|
449
468
|
stackTrace.stack,
|
|
450
|
-
|
|
469
|
+
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
451
470
|
);
|
|
452
471
|
break;
|
|
453
472
|
case import_opticore_catch_exception_error3.CErrorName.errOsslEvpUnsupported:
|
|
@@ -483,13 +502,21 @@ var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, int
|
|
|
483
502
|
// src/core/webServer.core.ts
|
|
484
503
|
var import_opticore_request_call_event = require("opticore-request-call-event");
|
|
485
504
|
|
|
486
|
-
// src/application/service/
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
|
|
505
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
506
|
+
var import_opticore_inject_dependency = require("opticore-inject-dependency");
|
|
507
|
+
var import_opticore_env_access3 = require("opticore-env-access");
|
|
508
|
+
|
|
509
|
+
// src/utils/envPath.utils.ts
|
|
510
|
+
var import_process = __toESM(require("process"), 1);
|
|
511
|
+
var envPath = import_process.default.cwd() + "/config/env/.env";
|
|
512
|
+
|
|
513
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
514
|
+
var SDependenciesContainer = (dependenciesProvider) => {
|
|
515
|
+
return new import_opticore_inject_dependency.SContainer(dependenciesProvider, (0, import_opticore_env_access3.getEnvironnementValue)(envPath).defaultLocal);
|
|
490
516
|
};
|
|
491
517
|
|
|
492
518
|
// src/core/webServer.core.ts
|
|
519
|
+
var import_opticore_http_response4 = require("opticore-http-response");
|
|
493
520
|
var WebServerCore = class {
|
|
494
521
|
serverUtility;
|
|
495
522
|
expressApp = (0, import_opticore_express2.express)();
|
|
@@ -505,7 +532,7 @@ var WebServerCore = class {
|
|
|
505
532
|
openSSLErrors;
|
|
506
533
|
systemErrors;
|
|
507
534
|
constructor(app, loggerConfig2, localLanguage, environnementPath, corsOriginOptions) {
|
|
508
|
-
this.getEnvironnement = (0,
|
|
535
|
+
this.getEnvironnement = (0, import_opticore_env_access4.getEnvironnementValue)(environnementPath);
|
|
509
536
|
this.routerExpressApp = app;
|
|
510
537
|
this.loggerConfig = loggerConfig2;
|
|
511
538
|
this.localLanguage = localLanguage;
|
|
@@ -525,7 +552,7 @@ var WebServerCore = class {
|
|
|
525
552
|
this.stackTraceErrorHandling(localLanguage);
|
|
526
553
|
this.translationWebAppLoader();
|
|
527
554
|
}
|
|
528
|
-
onStartServer(routers, dbConnexion,
|
|
555
|
+
onStartServer(routers, dbConnexion, dependenciesProvider) {
|
|
529
556
|
if (this.getEnvironnement.appHost === "" && Number(this.getEnvironnement.appPort) === 0) {
|
|
530
557
|
this.serverListenEvent.hostPortUndefined(Number(this.getEnvironnement.appPort));
|
|
531
558
|
} else if (this.getEnvironnement.appHost === "") {
|
|
@@ -534,7 +561,11 @@ var WebServerCore = class {
|
|
|
534
561
|
this.serverListenEvent.portUndefined();
|
|
535
562
|
} else if (this.localLanguage === "") {
|
|
536
563
|
SLogger().error(
|
|
537
|
-
|
|
564
|
+
"A default local language is not define. Please define it into .env file at the key : DEFAULT_LOCAL_LANG",
|
|
565
|
+
"Local lang missing",
|
|
566
|
+
"DEFAULT_LOCAL_LANG missing",
|
|
567
|
+
void 0,
|
|
568
|
+
import_opticore_http_response4.HttpStatusCode.NOT_FOUND
|
|
538
569
|
);
|
|
539
570
|
} else {
|
|
540
571
|
return this.expressApp.listen(
|
|
@@ -542,7 +573,7 @@ var WebServerCore = class {
|
|
|
542
573
|
() => {
|
|
543
574
|
try {
|
|
544
575
|
dbConnexion;
|
|
545
|
-
|
|
576
|
+
SDependenciesContainer(dependenciesProvider);
|
|
546
577
|
this.expressApp.use(import_opticore_express2.express.static(path3.join(import_node_process3.default.cwd(), "public/template")));
|
|
547
578
|
this.registerRoutes(routers);
|
|
548
579
|
} catch (err) {
|
|
@@ -610,10 +641,6 @@ var WebServerCore = class {
|
|
|
610
641
|
}
|
|
611
642
|
};
|
|
612
643
|
|
|
613
|
-
// src/utils/envPath.utils.ts
|
|
614
|
-
var import_process = __toESM(require("process"), 1);
|
|
615
|
-
var envPath = import_process.default.cwd() + "/config/env/.env";
|
|
616
|
-
|
|
617
644
|
// src/utils/stopServer.utils.ts
|
|
618
645
|
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
619
646
|
var import_child_process = require("child_process");
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { CorsOptions } from 'cors';
|
|
|
2
2
|
import { Server } from 'http';
|
|
3
3
|
import { Router, express } from 'opticore-express';
|
|
4
4
|
import { LoggerCore } from 'opticore-logger';
|
|
5
|
-
import {
|
|
5
|
+
import { TDependency } from 'opticore-inject-dependency';
|
|
6
6
|
|
|
7
7
|
interface IRouteDefinition {
|
|
8
8
|
path: string;
|
|
@@ -28,7 +28,7 @@ declare class WebServerCore {
|
|
|
28
28
|
private readonly openSSLErrors;
|
|
29
29
|
private readonly systemErrors;
|
|
30
30
|
constructor(app: express.Application, loggerConfig: LoggerCore, localLanguage: string, environnementPath: any, corsOriginOptions?: Partial<CorsOptions>);
|
|
31
|
-
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void,
|
|
31
|
+
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void, dependenciesProvider?: TDependency[]): any;
|
|
32
32
|
onListeningOnServerEvent(serverWeb: Server): void;
|
|
33
33
|
onRequestOnServerEvent(serverWeb: Server): void;
|
|
34
34
|
private translationWebAppLoader;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CorsOptions } from 'cors';
|
|
|
2
2
|
import { Server } from 'http';
|
|
3
3
|
import { Router, express } from 'opticore-express';
|
|
4
4
|
import { LoggerCore } from 'opticore-logger';
|
|
5
|
-
import {
|
|
5
|
+
import { TDependency } from 'opticore-inject-dependency';
|
|
6
6
|
|
|
7
7
|
interface IRouteDefinition {
|
|
8
8
|
path: string;
|
|
@@ -28,7 +28,7 @@ declare class WebServerCore {
|
|
|
28
28
|
private readonly openSSLErrors;
|
|
29
29
|
private readonly systemErrors;
|
|
30
30
|
constructor(app: express.Application, loggerConfig: LoggerCore, localLanguage: string, environnementPath: any, corsOriginOptions?: Partial<CorsOptions>);
|
|
31
|
-
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void,
|
|
31
|
+
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void, dependenciesProvider?: TDependency[]): any;
|
|
32
32
|
onListeningOnServerEvent(serverWeb: Server): void;
|
|
33
33
|
onRequestOnServerEvent(serverWeb: Server): void;
|
|
34
34
|
private translationWebAppLoader;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/core/webServer.core.ts
|
|
2
2
|
import * as path3 from "path";
|
|
3
|
-
import
|
|
3
|
+
import process5 from "node:process";
|
|
4
4
|
import { createRequire as createRequire2 } from "module";
|
|
5
5
|
import corsOrigin from "cors";
|
|
6
6
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
SystemErrors
|
|
14
14
|
} from "opticore-catch-exception-error";
|
|
15
15
|
import { express as express2 } from "opticore-express";
|
|
16
|
-
import { getEnvironnementValue as
|
|
16
|
+
import { getEnvironnementValue as getEnvironnementValue4 } from "opticore-env-access";
|
|
17
17
|
import { TranslationLoader as TranslationLoader5 } from "opticore-translator";
|
|
18
18
|
|
|
19
19
|
// src/core/handlers/eventProcess.handler.ts
|
|
@@ -84,7 +84,7 @@ import colors3 from "ansi-colors";
|
|
|
84
84
|
import { HttpStatusCode as status } from "opticore-http-response";
|
|
85
85
|
import { TranslationLoader as TranslationLoader3 } from "opticore-translator";
|
|
86
86
|
import { getEnvironnementValue as getEnvironnementValue2 } from "opticore-env-access";
|
|
87
|
-
import { LoggerCore } from "opticore-logger";
|
|
87
|
+
import { LoggerCore as LoggerCore2 } from "opticore-logger";
|
|
88
88
|
|
|
89
89
|
// src/core/helpers/modulesLoaded.utils.ts
|
|
90
90
|
import colors2 from "ansi-colors";
|
|
@@ -166,11 +166,30 @@ var loggerConfig = (envDir) => {
|
|
|
166
166
|
import path from "path";
|
|
167
167
|
import { createRequire } from "module";
|
|
168
168
|
import { TranslationLoader as TranslationLoader2 } from "opticore-translator";
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
|
|
170
|
+
// src/application/service/logger.service.ts
|
|
171
|
+
import { LoggerCore } from "opticore-logger";
|
|
172
|
+
var SLogger = () => {
|
|
173
|
+
return new LoggerCore();
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
// src/core/config/loaders/translateLanguage.loader.ts
|
|
177
|
+
import { HttpStatusCode } from "opticore-http-response";
|
|
178
|
+
var translateWebAppCoreLanguageLoader = (localLang) => {
|
|
179
|
+
try {
|
|
180
|
+
const require2 = createRequire(import.meta.url);
|
|
181
|
+
const packagePath = path.dirname(require2.resolve("opticore-webapp"));
|
|
182
|
+
const translateMsgJsonFilePath = path.join(packagePath, "utils", "translations");
|
|
183
|
+
TranslationLoader2.loadTranslations(translateMsgJsonFilePath);
|
|
184
|
+
} catch (error) {
|
|
185
|
+
SLogger().error(
|
|
186
|
+
TranslationLoader2.t(error.message, localLang),
|
|
187
|
+
TranslationLoader2.t("readdir", localLang),
|
|
188
|
+
TranslationLoader2.t("ENOENT:NoSuchFileOrDir", localLang),
|
|
189
|
+
error.stack,
|
|
190
|
+
HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
191
|
+
);
|
|
192
|
+
}
|
|
174
193
|
};
|
|
175
194
|
|
|
176
195
|
// src/application/service/core.service.ts
|
|
@@ -179,10 +198,10 @@ var CoreService = class {
|
|
|
179
198
|
localLanguage;
|
|
180
199
|
environnementPath;
|
|
181
200
|
constructor(localLang, environnementPath) {
|
|
182
|
-
|
|
201
|
+
translateWebAppCoreLanguageLoader(localLang);
|
|
202
|
+
this.loggerConfig = new LoggerCore2(loggerConfig(environnementPath));
|
|
183
203
|
this.environnementPath = environnementPath;
|
|
184
204
|
this.localLanguage = localLang;
|
|
185
|
-
translateWebAppCoreLanguageLoader();
|
|
186
205
|
}
|
|
187
206
|
/**
|
|
188
207
|
*
|
|
@@ -335,7 +354,7 @@ var CoreService = class {
|
|
|
335
354
|
// src/application/service/serverStartError.service.ts
|
|
336
355
|
import assert from "assert";
|
|
337
356
|
import { CErrorName } from "opticore-catch-exception-error";
|
|
338
|
-
import { HttpStatusCode } from "opticore-http-response";
|
|
357
|
+
import { HttpStatusCode as HttpStatusCode2 } from "opticore-http-response";
|
|
339
358
|
import { TranslationLoader as TranslationLoader4 } from "opticore-translator";
|
|
340
359
|
var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, internalErrors, logger, localLanguage) => {
|
|
341
360
|
switch (err.name) {
|
|
@@ -403,7 +422,7 @@ var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, int
|
|
|
403
422
|
const stackTrace = STraceError(
|
|
404
423
|
err.message,
|
|
405
424
|
err.name,
|
|
406
|
-
|
|
425
|
+
HttpStatusCode2.NOT_ACCEPTABLE,
|
|
407
426
|
true
|
|
408
427
|
);
|
|
409
428
|
err instanceof assert.AssertionError ? logger.error(
|
|
@@ -411,13 +430,13 @@ var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, int
|
|
|
411
430
|
"AssertionError",
|
|
412
431
|
stackTrace.name,
|
|
413
432
|
stackTrace.stack,
|
|
414
|
-
|
|
433
|
+
HttpStatusCode2.INTERNAL_SERVER_ERROR
|
|
415
434
|
) : logger.error(
|
|
416
435
|
TranslationLoader4.t(stackTrace.name, localLanguage),
|
|
417
436
|
"Another Error",
|
|
418
437
|
stackTrace.name,
|
|
419
438
|
stackTrace.stack,
|
|
420
|
-
|
|
439
|
+
HttpStatusCode2.INTERNAL_SERVER_ERROR
|
|
421
440
|
);
|
|
422
441
|
break;
|
|
423
442
|
case CErrorName.errOsslEvpUnsupported:
|
|
@@ -453,13 +472,21 @@ var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, int
|
|
|
453
472
|
// src/core/webServer.core.ts
|
|
454
473
|
import { requestCallsEvent } from "opticore-request-call-event";
|
|
455
474
|
|
|
456
|
-
// src/application/service/
|
|
457
|
-
import {
|
|
458
|
-
|
|
459
|
-
|
|
475
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
476
|
+
import { SContainer } from "opticore-inject-dependency";
|
|
477
|
+
import { getEnvironnementValue as getEnvironnementValue3 } from "opticore-env-access";
|
|
478
|
+
|
|
479
|
+
// src/utils/envPath.utils.ts
|
|
480
|
+
import process4 from "process";
|
|
481
|
+
var envPath = process4.cwd() + "/config/env/.env";
|
|
482
|
+
|
|
483
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
484
|
+
var SDependenciesContainer = (dependenciesProvider) => {
|
|
485
|
+
return new SContainer(dependenciesProvider, getEnvironnementValue3(envPath).defaultLocal);
|
|
460
486
|
};
|
|
461
487
|
|
|
462
488
|
// src/core/webServer.core.ts
|
|
489
|
+
import { HttpStatusCode as HttpStatusCode3 } from "opticore-http-response";
|
|
463
490
|
var WebServerCore = class {
|
|
464
491
|
serverUtility;
|
|
465
492
|
expressApp = express2();
|
|
@@ -475,7 +502,7 @@ var WebServerCore = class {
|
|
|
475
502
|
openSSLErrors;
|
|
476
503
|
systemErrors;
|
|
477
504
|
constructor(app, loggerConfig2, localLanguage, environnementPath, corsOriginOptions) {
|
|
478
|
-
this.getEnvironnement =
|
|
505
|
+
this.getEnvironnement = getEnvironnementValue4(environnementPath);
|
|
479
506
|
this.routerExpressApp = app;
|
|
480
507
|
this.loggerConfig = loggerConfig2;
|
|
481
508
|
this.localLanguage = localLanguage;
|
|
@@ -495,7 +522,7 @@ var WebServerCore = class {
|
|
|
495
522
|
this.stackTraceErrorHandling(localLanguage);
|
|
496
523
|
this.translationWebAppLoader();
|
|
497
524
|
}
|
|
498
|
-
onStartServer(routers, dbConnexion,
|
|
525
|
+
onStartServer(routers, dbConnexion, dependenciesProvider) {
|
|
499
526
|
if (this.getEnvironnement.appHost === "" && Number(this.getEnvironnement.appPort) === 0) {
|
|
500
527
|
this.serverListenEvent.hostPortUndefined(Number(this.getEnvironnement.appPort));
|
|
501
528
|
} else if (this.getEnvironnement.appHost === "") {
|
|
@@ -504,7 +531,11 @@ var WebServerCore = class {
|
|
|
504
531
|
this.serverListenEvent.portUndefined();
|
|
505
532
|
} else if (this.localLanguage === "") {
|
|
506
533
|
SLogger().error(
|
|
507
|
-
|
|
534
|
+
"A default local language is not define. Please define it into .env file at the key : DEFAULT_LOCAL_LANG",
|
|
535
|
+
"Local lang missing",
|
|
536
|
+
"DEFAULT_LOCAL_LANG missing",
|
|
537
|
+
void 0,
|
|
538
|
+
HttpStatusCode3.NOT_FOUND
|
|
508
539
|
);
|
|
509
540
|
} else {
|
|
510
541
|
return this.expressApp.listen(
|
|
@@ -512,8 +543,8 @@ var WebServerCore = class {
|
|
|
512
543
|
() => {
|
|
513
544
|
try {
|
|
514
545
|
dbConnexion;
|
|
515
|
-
|
|
516
|
-
this.expressApp.use(express2.static(path3.join(
|
|
546
|
+
SDependenciesContainer(dependenciesProvider);
|
|
547
|
+
this.expressApp.use(express2.static(path3.join(process5.cwd(), "public/template")));
|
|
517
548
|
this.registerRoutes(routers);
|
|
518
549
|
} catch (err) {
|
|
519
550
|
SServerStartError(
|
|
@@ -580,10 +611,6 @@ var WebServerCore = class {
|
|
|
580
611
|
}
|
|
581
612
|
};
|
|
582
613
|
|
|
583
|
-
// src/utils/envPath.utils.ts
|
|
584
|
-
import process5 from "process";
|
|
585
|
-
var envPath = process5.cwd() + "/config/env/.env";
|
|
586
|
-
|
|
587
614
|
// src/utils/stopServer.utils.ts
|
|
588
615
|
import dotenv from "dotenv";
|
|
589
616
|
import { execSync } from "child_process";
|
|
@@ -89,5 +89,8 @@
|
|
|
89
89
|
"errorDBHost": "A database host {host} does not allow connection. Please either set the host like this: {localhost} in your .env file",
|
|
90
90
|
"serverPortKill": "Server which started on port {port} has been stopped successfully.",
|
|
91
91
|
"pidOnPortNotFound": "No process found on port {port}.",
|
|
92
|
-
"noProcessRunningOnPort": "Error: No process running on port {port}"
|
|
92
|
+
"noProcessRunningOnPort": "Error: No process running on port {port}",
|
|
93
|
+
"noDefaultLocalLang": "A default local language is not define. Please define it into .env file at the key : DEFAULT_LOCAL_LANG",
|
|
94
|
+
"noLocalLang": "Local lang missing",
|
|
95
|
+
"localLangMissing": "DEFAULT_LOCAL_LANG missing"
|
|
93
96
|
}
|
|
@@ -89,5 +89,8 @@
|
|
|
89
89
|
"errorDBHost": "L'hôte de la base de données {host} n'autorise pas la connexion. Veuillez définir l'hôte comme suit : {localhost} dans votre fichier .env",
|
|
90
90
|
"serverPortKill": "Serveur qui a démarré sur le port {port} a été arrêté avec succès.",
|
|
91
91
|
"pidOnPortNotFound": "Aucun processus trouvé sur le port {port}.",
|
|
92
|
-
"noProcessRunningOnPort": "Erreur : Aucun processus en cours sur le port {port}."
|
|
92
|
+
"noProcessRunningOnPort": "Erreur : Aucun processus en cours sur le port {port}.",
|
|
93
|
+
"noDefaultLocalLang": "La langue locale par défaut n'est pas définie. Veuillez le définir dans le fichier .env a la clé: DEFAULT_LOCAL_LANG",
|
|
94
|
+
"noLocalLang": "Langue local manquante",
|
|
95
|
+
"localLangMissing": "DEFAULT_LOCAL_LANG manquante"
|
|
93
96
|
}
|