Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.devnet
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
NETWORK=devnet
API_URL=https://devnet-api.multiversx.com

DATABASE_HOST=mongodb://localhost:27017
DATABASE_NAME=template
DATABASE_USERNAME=
DATABASE_PASSWORD=

REDIS_HOST=localhost
REDIS_PORT=6379
8 changes: 8 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
NETWORK=mainnet
API_URL=https://api.multiversx.com

DATABASE_HOST=mongodb://localhost:27017
DATABASE_NAME=template
DATABASE_USERNAME=
DATABASE_PASSWORD=

REDIS_HOST=localhost
REDIS_PORT=6379
8 changes: 8 additions & 0 deletions .env.testnet
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
NETWORK=testnet
API_URL=https://testnet-api.multiversx.com

DATABASE_HOST=mongodb://localhost:27017
DATABASE_NAME=template
DATABASE_USERNAME=
DATABASE_PASSWORD=

REDIS_HOST=localhost
REDIS_PORT=6379
8 changes: 8 additions & 0 deletions .multiversx/config/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
NODE_ENV=infra
NETWORK=
API_URL=

DATABASE_HOST=mongodb://localhost:27017
DATABASE_NAME=template
DATABASE_USERNAME=
DATABASE_PASSWORD=

REDIS_HOST=localhost
REDIS_PORT=6379
13 changes: 6 additions & 7 deletions .multiversx/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ libs:
urls:
api: ${API_URL}
database:
host: 'localhost'
port: 27017
# username: 'root'
# password: 'root'
name: 'example'
host: ${DATABASE_HOST}
username: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
name: ${DATABASE_NAME}
tlsAllowInvalidCertificates: true
redis:
host: '127.0.0.1'
port: 6379
host: ${REDIS_HOST}
port: ${num:REDIS_PORT}
nativeAuth:
# maxExpirySeconds:
acceptedOrigins:
Expand Down
13 changes: 6 additions & 7 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ libs:
urls:
api: ${API_URL}
database:
host: 'localhost'
port: 27017
# username: 'root'
# password: 'root'
name: 'example'
host: ${DATABASE_HOST}
username: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
name: ${DATABASE_NAME}
tlsAllowInvalidCertificates: true
redis:
host: '127.0.0.1'
port: 6379
host: ${REDIS_HOST}
port: ${num:REDIS_PORT}
nativeAuth:
# maxExpirySeconds:
acceptedOrigins:
Expand Down
1 change: 0 additions & 1 deletion config/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ libs:
api: string
database:
host: string
port: integer
username:
type: string
required: false
Expand Down
1 change: 0 additions & 1 deletion libs/common/src/entities/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export interface Config {
};
database: {
host: string;
port: number;
username?: string;
password?: string;
name: string;
Expand Down
2 changes: 1 addition & 1 deletion libs/database/src/database.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { UserRepository } from './repositories';
MongooseModule.forRootAsync({
imports: [CommonConfigModule],
useFactory: (configService: CommonConfigService) => ({
uri: `mongodb://${configService.config.database.host}:${configService.config.database.port}`,
uri: configService.config.database.host,
dbName: configService.config.database.name,
user: configService.config.database.username,
pass: configService.config.database.password,
Expand Down