implementation of env
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { Module } from "@nestjs/common";
|
||||
import { NotificationModule } from "./notifications/notification.mudule";
|
||||
import { SequelizeModule } from "@nestjs/sequelize";
|
||||
import { ConfigModule } from "@nestjs/config";
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot(),
|
||||
SequelizeModule.forRoot({
|
||||
dialect: "mysql",
|
||||
host: "localhost",
|
||||
port: 3306,
|
||||
username: "root",
|
||||
password: "",
|
||||
database: "notification_db",
|
||||
host: process.env.DB_HOST,
|
||||
port: parseInt(process.env.DB_PORT),
|
||||
username: process.env.DB_USERNAME,
|
||||
password: process.env.DB_PASSWORD,
|
||||
database: process.env.DB_NAME,
|
||||
autoLoadModels: true,
|
||||
synchronize: true,
|
||||
}),
|
||||
|
||||
@@ -7,7 +7,7 @@ async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
app.useGlobalPipes(new ValidationPipe());
|
||||
app.useWebSocketAdapter(new IoAdapter(app));
|
||||
await app.listen(3001);
|
||||
await app.listen(parseInt(process.env.PORT));
|
||||
}
|
||||
|
||||
bootstrap();
|
||||
|
||||
Reference in New Issue
Block a user