Skip to content

Commit

Permalink
Implmented env file st
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwas1 committed Jan 16, 2023
1 parent 664b2d4 commit 2d119e6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_CONNECTION_PATH=mongodb://127.0.0.1:27017/studio-api
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.0.0",
"@nestjs/mongoose": "^9.2.1",
"@nestjs/platform-express": "^9.0.0",
Expand Down
6 changes: 5 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { Module } from '@nestjs/common';
import { AppAuthModule } from './app-auth/app-auth.module';
import { MongooseModule } from '@nestjs/mongoose';
import { ConfigModule } from '@nestjs/config';
@Module({
imports: [
AppAuthModule,
MongooseModule.forRoot('mongodb://127.0.0.1:27017/studio-api'),
ConfigModule.forRoot({
envFilePath: '.dev.env'
}),
MongooseModule.forRoot(process.env.DATABASE_CONNECTION_PATH)
],
controllers: [],
providers: [],
Expand Down
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,16 @@
tslib "2.4.1"
uuid "9.0.0"

"@nestjs/config@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@nestjs/config/-/config-2.2.0.tgz#9f3da35f7c4a58724c0a0817d6f04b66e6703430"
integrity sha512-78Eg6oMbCy3D/YvqeiGBTOWei1Jwi3f2pSIZcZ1QxY67kYsJzTRTkwRT8Iv30DbK0sGKc1mcloDLD5UXgZAZtg==
dependencies:
dotenv "16.0.1"
dotenv-expand "8.0.3"
lodash "4.17.21"
uuid "8.3.2"

"@nestjs/core@^9.0.0":
version "9.2.1"
resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.2.1.tgz#598e51a421a0aaafc568c1a02499f7c1f9491caf"
Expand Down Expand Up @@ -2726,6 +2736,16 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

dotenv-expand@8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-8.0.3.tgz#29016757455bcc748469c83a19b36aaf2b83dd6e"
integrity sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==

dotenv@16.0.1:
version "16.0.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.1.tgz#8f8f9d94876c35dac989876a5d3a82a267fdce1d"
integrity sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==

ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
Expand Down

0 comments on commit 2d119e6

Please sign in to comment.