feat: add global ConfigModule setup in DatabaseModule and remove from AppModule
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
import { Module } from "@nestjs/common";
|
import { Module } from "@nestjs/common";
|
||||||
import { ConfigModule } from "@nestjs/config";
|
|
||||||
import { TestModule } from "../test/test.module";
|
import { TestModule } from "../test/test.module";
|
||||||
import { ApiModule } from "../api/api.module";
|
import { ApiModule } from "../api/api.module";
|
||||||
import { QueryModule } from "src/query/query.module";
|
import { QueryModule } from "src/query/query.module";
|
||||||
@ -9,10 +8,6 @@ import { DatabaseModule } from "src/database/database.module";
|
|||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
ConfigModule.forRoot({
|
|
||||||
isGlobal: true,
|
|
||||||
envFilePath: ".env",
|
|
||||||
}),
|
|
||||||
DatabaseModule,
|
DatabaseModule,
|
||||||
RedisModule,
|
RedisModule,
|
||||||
ApiModule,
|
ApiModule,
|
||||||
|
|||||||
@ -1,8 +1,13 @@
|
|||||||
import { Module } from "@nestjs/common";
|
import { Module } from "@nestjs/common";
|
||||||
|
import { ConfigModule } from "@nestjs/config";
|
||||||
import { TypeOrmModule } from "@nestjs/typeorm";
|
import { TypeOrmModule } from "@nestjs/typeorm";
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
|
ConfigModule.forRoot({
|
||||||
|
isGlobal: true,
|
||||||
|
envFilePath: ".env",
|
||||||
|
}),
|
||||||
TypeOrmModule.forRoot({
|
TypeOrmModule.forRoot({
|
||||||
type: "mariadb",
|
type: "mariadb",
|
||||||
host: process.env.DB_HOST || "localhost",
|
host: process.env.DB_HOST || "localhost",
|
||||||
|
|||||||
Reference in New Issue
Block a user