Browse Source

add .env file

entities
zarsa 2 years ago
parent
commit
25efed90cd
  1. 2
      .gitignore
  2. 11
      db/data-source.ts
  3. 41
      package-lock.json
  4. 3
      package.json
  5. 2
      src/app.module.ts

2
.gitignore vendored

@ -33,3 +33,5 @@ lerna-debug.log* @@ -33,3 +33,5 @@ lerna-debug.log*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.env

11
db/data-source.ts

@ -1,12 +1,13 @@ @@ -1,12 +1,13 @@
import { DataSource, DataSourceOptions } from 'typeorm';
import 'dotenv/config';
export const dataSourceOptions: DataSourceOptions = {
type: 'mssql',
host: '193.176.240.223\\sql2017',
port: 1433,
username: 'sa',
password: 'Zar@Sql2017#1397',
database: 'TirebanClub',
host: process.env.DATABASE_HOSTNAME,
port: Number(process.env.DATABASE_PORT),
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
entities: ['dist/**/*.entity{.ts,.js}'],
synchronize: true,
options: {

41
package-lock.json generated

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
"license": "UNLICENSED",
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/platform-express": "^9.0.0",
@ -1705,6 +1706,38 @@ @@ -1705,6 +1706,38 @@
}
}
},
"node_modules/@nestjs/config": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/@nestjs/config/-/config-2.3.2.tgz",
"integrity": "sha512-VtGV8PBpxzMzz68kdxTWqPm9v7SYCSZXQ0tC72AMNnjdmU+CVjUSLpEpdnm0XcWHxE1nV6wSI3HZxsATIV4ZxA==",
"dependencies": {
"dotenv": "16.0.3",
"dotenv-expand": "10.0.0",
"lodash": "4.17.21",
"uuid": "9.0.0"
},
"peerDependencies": {
"@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^6.0.0 || ^7.2.0"
}
},
"node_modules/@nestjs/config/node_modules/dotenv": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
"engines": {
"node": ">=12"
}
},
"node_modules/@nestjs/config/node_modules/uuid": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
"integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@nestjs/core": {
"version": "9.4.2",
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-9.4.2.tgz",
@ -3752,6 +3785,14 @@ @@ -3752,6 +3785,14 @@
"url": "https://github.com/motdotla/dotenv?sponsor=1"
}
},
"node_modules/dotenv-expand": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz",
"integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==",
"engines": {
"node": ">=12"
}
},
"node_modules/ecdsa-sig-formatter": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",

3
package.json

@ -22,11 +22,10 @@ @@ -22,11 +22,10 @@
"m:g": "npm run build && npx typeorm migration:generate ./db/migrations/refactoring -d dist/db/data-source.js",
"m:r": "npm run typeorm -- migration:run",
"migration:revert": "npm run typeorm -- migration:revert"
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/platform-express": "^9.0.0",

2
src/app.module.ts

@ -6,9 +6,11 @@ import { UsersModule } from './users/users.module'; @@ -6,9 +6,11 @@ import { UsersModule } from './users/users.module';
import { PersonsModule } from './persons/persons.module';
import { GroupsModule } from './groups/groups.module';
import { dataSourceOptions } from 'db/data-source';
import { ConfigModule } from '@nestjs/config';
@Module({
imports: [
ConfigModule.forRoot(),
TypeOrmModule.forRoot(dataSourceOptions),
UsersModule,
PersonsModule,

Loading…
Cancel
Save