diff options
author | Joseph Ditton <jditton.atomic@gmail.com> | 2021-11-16 19:14:46 -0700 |
---|---|---|
committer | Joseph Ditton <jditton.atomic@gmail.com> | 2021-11-16 19:14:46 -0700 |
commit | cba40b6aff598e821199c186c5f1795e5252bab9 (patch) | |
tree | a5e4ad3bae238c3921e10956f21f84ca352c7d6d /server/database/config.ts | |
parent | e5f684001370d6f6348fd26f97bc26c765deb934 (diff) | |
download | locchat-cba40b6aff598e821199c186c5f1795e5252bab9.tar.gz locchat-cba40b6aff598e821199c186c5f1795e5252bab9.zip |
separate client and server apps
Diffstat (limited to 'server/database/config.ts')
-rw-r--r-- | server/database/config.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/database/config.ts b/server/database/config.ts new file mode 100644 index 0000000..80f479a --- /dev/null +++ b/server/database/config.ts @@ -0,0 +1,16 @@ +import { TypeOrmModuleOptions } from '@nestjs/typeorm'; +import '../env'; + +export const config: TypeOrmModuleOptions = + process.env.NODE_ENV === 'development' + ? { + type: 'postgres', + host: 'localhost', + port: 5432, + database: process.env.DATABASE_URL, + autoLoadEntities: true, + } + : { + url: process.env.DATABASE_URL, + ssl: { rejectUnauthorized: true }, + }; |