@atlantjs/backend 1.0.23 → 1.1.0
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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DatabaseConfigAbstract = void 0;
|
|
4
|
+
const env_vars_1 = require("../env/env-vars");
|
|
4
5
|
const arch_1 = require("@atlantjs/arch");
|
|
5
6
|
const typeorm_1 = require("typeorm");
|
|
6
7
|
class DatabaseConfigAbstract {
|
|
@@ -21,7 +22,7 @@ class DatabaseConfigAbstract {
|
|
|
21
22
|
username: this.props.username,
|
|
22
23
|
password: this.props.password,
|
|
23
24
|
database: this.props.database,
|
|
24
|
-
synchronize: arch_1.Guardian.isFalsy((0,
|
|
25
|
+
synchronize: arch_1.Guardian.isFalsy((0, env_vars_1.isProdOrHomolog)()),
|
|
25
26
|
entities: [`${__dirname}/../../../../../../**/*.schema{.ts,.js}`],
|
|
26
27
|
migrations: ["./migrations/*.ts"],
|
|
27
28
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { NodeEnvs } from "@atlantjs/arch";
|
|
1
2
|
export declare const IAM_MOVINGAPP_REALM_PUBLIC_KEY_RS256: string | undefined;
|
|
2
3
|
export declare const APP_PORT: number;
|
|
3
4
|
export declare const LOAD_MODULES: string[];
|
|
4
5
|
export declare const CORS_ALLOWED_ORIGINS: string;
|
|
6
|
+
export declare const ENVIRONMENT: NodeEnvs;
|
|
7
|
+
export declare const isProdOrHomolog: () => boolean;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.APP_PORT = exports.IAM_MOVINGAPP_REALM_PUBLIC_KEY_RS256 = void 0;
|
|
6
|
+
exports.isProdOrHomolog = exports.ENVIRONMENT = exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.APP_PORT = exports.IAM_MOVINGAPP_REALM_PUBLIC_KEY_RS256 = void 0;
|
|
7
|
+
const arch_1 = require("@atlantjs/arch");
|
|
7
8
|
const env_var_1 = __importDefault(require("env-var"));
|
|
8
9
|
exports.IAM_MOVINGAPP_REALM_PUBLIC_KEY_RS256 = env_var_1.default
|
|
9
10
|
.get("KEYCLOAK_MOVINGAPP_REALM_PUBLIC_KEY_RS256")
|
|
@@ -14,3 +15,14 @@ exports.CORS_ALLOWED_ORIGINS = env_var_1.default
|
|
|
14
15
|
.get("CORS_ALLOWED_ORIGINS")
|
|
15
16
|
.default("*")
|
|
16
17
|
.asString();
|
|
18
|
+
exports.ENVIRONMENT = env_var_1.default
|
|
19
|
+
.get("ENVIRONMENT")
|
|
20
|
+
.required()
|
|
21
|
+
.asEnum([
|
|
22
|
+
arch_1.NodeEnvs.test,
|
|
23
|
+
arch_1.NodeEnvs.development,
|
|
24
|
+
arch_1.NodeEnvs.production,
|
|
25
|
+
arch_1.NodeEnvs.homolog,
|
|
26
|
+
]);
|
|
27
|
+
const isProdOrHomolog = () => [arch_1.NodeEnvs.homolog, arch_1.NodeEnvs.production].includes(exports.ENVIRONMENT);
|
|
28
|
+
exports.isProdOrHomolog = isProdOrHomolog;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlantjs/backend",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"test:unit:cov": "yarn test:unit --coverage --runInBand"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlantjs/arch": "^4.1.
|
|
35
|
+
"@atlantjs/arch": "^4.1.7",
|
|
36
36
|
"body-parser": "^1.20.3",
|
|
37
37
|
"class-transformer": "^0.5.1",
|
|
38
38
|
"class-validator": "^0.14.1",
|
package/setup/server/server.js
CHANGED
|
@@ -34,7 +34,7 @@ class Server {
|
|
|
34
34
|
console.info(LogMessage.$start_server);
|
|
35
35
|
Server.instance.listen(env_vars_1.APP_PORT, () => {
|
|
36
36
|
console.info(LogMessage.$started_server + env_vars_1.APP_PORT);
|
|
37
|
-
if (arch_1.Guardian.isEqual(
|
|
37
|
+
if (arch_1.Guardian.isEqual(env_vars_1.ENVIRONMENT, arch_1.NodeEnvs.development)) {
|
|
38
38
|
Server.logFooterDevelopmentMessage();
|
|
39
39
|
}
|
|
40
40
|
});
|