-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): make typeorm work with 'ng serve api'
- Loading branch information
Showing
25 changed files
with
210 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
import { DynamicModule, Global, Module } from '@nestjs/common'; | ||
import { Global, Module } from '@nestjs/common'; | ||
|
||
import { ConfigService } from './config.service'; | ||
|
||
@Global() | ||
@Module({}) | ||
export class ConfigModule { | ||
static forRoot(filePath?: string): DynamicModule { | ||
return { | ||
module: ConfigModule, | ||
providers: [ | ||
{ | ||
provide: ConfigService, | ||
useValue: new ConfigService(filePath || `${process.env.NODE_ENV || 'development'}.env`), | ||
}, | ||
], | ||
exports: [ConfigService], | ||
}; | ||
} | ||
} | ||
@Module({ | ||
providers: [ConfigService], | ||
exports: [ConfigService], | ||
}) | ||
export class ConfigModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export * from './core.module'; | ||
export * from './services/base-remote.service'; | ||
export * from './entities/base.entity'; | ||
export * from './entities/audit-base.entity'; | ||
export * from './crud/crud.service'; | ||
export * from './crud/crud.controller'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,52 @@ export const environment = { | |
production: true, | ||
|
||
NODE_ENV: 'production', | ||
DOMAIN_URL: 'http://localhost:3000', | ||
PORT: 3000, | ||
GLOBAL_PREFIX: '/api', | ||
NODE_TLS_REJECT_UNAUTHORIZED: 0, | ||
|
||
TYPEORM_CONNECTION: 'postgres', | ||
TYPEORM_HOST: 'postgres', | ||
TYPEORM_PORT: 5432, | ||
TYPEORM_DATABASE: 'cockpit', | ||
TYPEORM_USERNAME: 'cockpit', | ||
TYPEORM_PASSWORD: 'cockpit123', | ||
server: { | ||
host: 'localhost', | ||
domainUrl: 'http://localhost:3000', | ||
port: 3000, | ||
globalPrefix: '/api', | ||
}, | ||
|
||
TYPEORM_SYNCHRONIZE: false, | ||
TYPEORM_LOGGING: false, | ||
TYPEORM_ENTITIES: './dist/**/**.entity.js', | ||
database: { | ||
type: 'postgres', | ||
host: process.env.TYPEORM_HOST || 'postgres', | ||
port: process.env.TYPEORM_PORT ? Number(process.env.TYPEORM_PORT) : 5432, | ||
database: process.env.TYPEORM_DATABASE || 'cockpit', | ||
username: process.env.TYPEORM_USERNAME || 'cockpit', | ||
password: process.env.TYPEORM_PASSWORD || 'cockpit123', | ||
keepConnectionAlive: true, | ||
logging: process.env.TYPEORM_LOGGING ? JSON.parse(process.env.TYPEORM_LOGGING) : false, | ||
synchronize: false, | ||
}, | ||
|
||
// OIDC_ISSUER_URL: 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/kubernetes', | ||
// OIDC_CLIENT: 'cockpit', | ||
OIDC_ISSUER_URL: 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/is360', | ||
OIDC_CLIENT: 'is360ui', | ||
oidc: { | ||
// issuerUrl: 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/kubernetes', | ||
// client: 'cockpit', | ||
issuerUrl: process.env.OIDC_ISSUER_URL || 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/is360', | ||
client: process.env.OIDC_CLIENT || 'is360ui', | ||
}, | ||
|
||
EMAIL_HOST: 'mail.google.com', | ||
EMAIL_PORT: 25, | ||
EMAIL_FROM: '"sumo demo" <[email protected]>', | ||
EMAIL_TEMPLATE_DIR: 'apps/api/email-templates', | ||
email: { | ||
transport: { | ||
host: process.env.EMAIL_HOST || 'mail.google.com', | ||
port: process.env.EMAIL_PORT ? Number(process.env.EMAIL_PORT) : 25, | ||
secure: process.env.EMAIL_SECURE ? JSON.parse(process.env.EMAIL_SECURE) : false, | ||
auth: { | ||
user: process.env.EMAIL_AUTH_USER || 'auth_user', | ||
pass: process.env.EMAIL_AUTH_PASS || 'auth_pass', | ||
}, | ||
}, | ||
defaults: { | ||
from: process.env.EMAIL_FROM ? process.env.EMAIL_FROM : '"sumo demo" <[email protected]>', | ||
}, | ||
templateDir: process.env.EMAIL_TEMPLATE_DIR || 'apps/api/email-templates', | ||
}, | ||
|
||
webPush: { | ||
publicVapidKey: 'BAJq-yHlSNjUqKW9iMY0hG96X9WdVwetUFDa5rQIGRPqOHKAL_fkKUe_gUTAKnn9IPAltqmlNO2OkJrjdQ_MXNg', | ||
privateVapidKey: 'cwh2CYK5h_B_Gobnv8Ym9x61B3qFE2nTeb9BeiZbtMI', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,33 +4,51 @@ | |
|
||
export const environment = { | ||
production: false, | ||
|
||
NODE_ENV: 'development', | ||
DOMAIN_URL: 'http://localhost:3000', | ||
PORT: 3000, | ||
GLOBAL_PREFIX: '/api', | ||
NODE_TLS_REJECT_UNAUTHORIZED: 0, | ||
ALLOW_WHITE_LIST: '::ffff:127.0.0.1,::1', | ||
|
||
ALLOW_WHITE_LIST: ['::ffff:127.0.0.1', '::1'], | ||
LOG_LEVEL: 'debug', | ||
|
||
TYPEORM_CONNECTION: 'postgres', | ||
TYPEORM_HOST: 'localhost', | ||
TYPEORM_PORT: 5432, | ||
TYPEORM_DATABASE: 'cockpit', | ||
TYPEORM_USERNAME: 'cockpit', | ||
TYPEORM_PASSWORD: 'cockpit123', | ||
server: { | ||
host: 'localhost', | ||
domainUrl: 'http://localhost:3000', | ||
port: 3000, | ||
globalPrefix: '/api', | ||
}, | ||
|
||
database: { | ||
type: 'postgres', | ||
host: 'localhost', | ||
port: 5432, | ||
database: 'cockpit', | ||
username: 'cockpit', | ||
password: 'cockpit123', | ||
keepConnectionAlive: true, | ||
logging: true, | ||
synchronize: true, | ||
}, | ||
|
||
TYPEORM_SYNCHRONIZE: true, | ||
TYPEORM_LOGGING: true, | ||
TYPEORM_ENTITIES: './**/**.entity{.ts,.js}', | ||
oidc: { | ||
// issuerUrl: 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/kubernetes', | ||
// client: 'cockpit', | ||
issuerUrl: process.env.OIDC_ISSUER_URL || 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/is360', | ||
client: process.env.OIDC_CLIENT || 'is360ui', | ||
}, | ||
|
||
// OIDC_ISSUER_URL: 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/kubernetes', | ||
// OIDC_CLIENT: 'cockpit', | ||
OIDC_ISSUER_URL: 'https://myroute-is360.a3c1.starter-us-west-1.openshiftapps.com/auth/realms/is360', | ||
OIDC_CLIENT: 'is360ui', | ||
email: { | ||
transport: { | ||
host: 'mail.google.com', | ||
port: 25, | ||
}, | ||
defaults: { | ||
from: '"sumo demo" <[email protected]>', | ||
}, | ||
templateDir: 'apps/api/email-templates', | ||
}, | ||
|
||
EMAIL_HOST: 'mail.google.com', | ||
EMAIL_PORT: 25, | ||
EMAIL_FROM: '"sumo demo" <[email protected]>', | ||
EMAIL_TEMPLATE_DIR: 'apps/api/email-templates', | ||
webPush: { | ||
publicVapidKey: 'BAJq-yHlSNjUqKW9iMY0hG96X9WdVwetUFDa5rQIGRPqOHKAL_fkKUe_gUTAKnn9IPAltqmlNO2OkJrjdQ_MXNg', | ||
privateVapidKey: 'cwh2CYK5h_B_Gobnv8Ym9x61B3qFE2nTeb9BeiZbtMI', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.