Skip to content
Open
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
Empty file added .app.service.ts.swp
Empty file.
113 changes: 70 additions & 43 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,71 @@
module.exports = {
apps : [
{
name: "irctc",
script: "node dist/main",
watch: true,
env: {
"PORT": 7003,
"NODE_ENV": "development",
"REDIS_URL":"redis://stock-app.redis.cache.windows.net:6379",
"REDIS_PASSWORD": "max0E2YSIGMt3KLIDCJrc7KA2BqgAwQE7AzCaNH8u24=",
"STOCK": "irctc",
"STOCK_PUBSUB": "irctc_pub",

},
},
{
name: "tata_mtr",
script: "node dist/main",
watch: true,
env: {
"PORT": 7001,
"NODE_ENV": "development",
"REDIS_URL":"redis://stock-app.redis.cache.windows.net:6379",
"REDIS_PASSWORD": "max0E2YSIGMt3KLIDCJrc7KA2BqgAwQE7AzCaNH8u24=",
"STOCK": "tata_mtr",
"STOCK_PUBSUB": "tata_mtr_pub",
},
},
{
name: "mrf",
script: "node dist/main",
watch: true,
env: {
"PORT": 7002,
"NODE_ENV": "development",
"REDIS_URL":"redis://stock-app.redis.cache.windows.net:6379",
"REDIS_PASSWORD": "max0E2YSIGMt3KLIDCJrc7KA2BqgAwQE7AzCaNH8u24=",
"STOCK": "mrf",
"STOCK_PUBSUB": "mrf_pub",
},
}
]
}
apps: [
{
name: 'irctc',
script: 'node dist/src/main',
watch: true,
env: {
PORT: 7003,
NODE_ENV: 'development',
//"REDIS_URL":"redis://stock-app.redis.cache.windows.net:6379",
POSTGRES_URL:
'postgres-database.c03ry3tigtjx.ap-south-1.rds.amazonaws.com',
POSTGRES_PORT: '5432',
POSTGRES_USERNAME: 'postgres',
POSTGRES_PASSWORD: 'Stock123',
POSTGRES_DATABASE: 'postgres',
REDIS_URL: 'redis://127.0.0.1:6379',
REDIS_PASSWORD: 'redis',
//"REDIS_PASSWORD": "max0E2YSIGMt3KLIDCJrc7KA2BqgAwQE7AzCaNH8u24=",
STOCK: 'irctc',
COMPANY: 'IRCTC',
STOCK_PUBSUB: 'irctc_pub',
},
},
{
name: 'tata_mtr',
script: 'node dist/src/main',
watch: true,
env: {
PORT: 7001,
NODE_ENV: 'development',
POSTGRES_URL:
'postgres-database.c03ry3tigtjx.ap-south-1.rds.amazonaws.com',
POSTGRES_PORT: '5432',
POSTGRES_USERNAME: 'postgres',
POSTGRES_PASSWORD: 'Stock123',
POSTGRES_DATABASE: 'postgres',
//"REDIS_URL":"redis://stock-app.redis.cache.windows.net:6379",
REDIS_URL: 'redis://127.0.0.1:6379',
REDIS_PASSWORD: 'redis',
//"REDIS_PASSWORD": "max0E2YSIGMt3KLIDCJrc7KA2BqgAwQE7AzCaNH8u24=",
POSTGRES_DATABASE: 'postgres',
STOCK: 'tata_mtr',
COMPANY: 'TATAMOTORS',
STOCK_PUBSUB: 'tata_mtr_pub',
},
},
{
name: 'mrf',
script: 'node dist/src/main',
watch: true,
env: {
PORT: 7002,
NODE_ENV: 'development',
POSTGRES_URL:
'postgres-database.c03ry3tigtjx.ap-south-1.rds.amazonaws.com',
POSTGRES_PORT: '5432',
POSTGRES_USERNAME: 'postgres',
POSTGRES_PASSWORD: 'Stock123',
POSTGRES_DATABASE: 'postgres',
//"REDIS_URL":"redis://stock-app.redis.cache.windows.net:6379",
REDIS_URL: 'redis://127.0.0.1:6379',
REDIS_PASSWORD: 'redis',
//"REDIS_PASSWORD": "max0E2YSIGMt3KLIDCJrc7KA2BqgAwQE7AzCaNH8u24=",
STOCK: 'mrf',
COMPANY: 'MRF',
STOCK_PUBSUB: 'mrf_pub',
},
},
],
};
39 changes: 39 additions & 0 deletions ormconfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { OrderEntity } from 'src/entities/order_entity';
import { DataSource } from 'typeorm';

export const ormConfig: TypeOrmModuleOptions = {
type: 'postgres',
host: process.env.POSTGRES_URL,
port: parseInt(process.env.POSTGRES_PORT),
username: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
autoLoadEntities: true,
entities: [
'dist/src/entities/**/*{.ts,.js}',
],
database: 'postgres',
synchronize: false,
migrations: ['dist/src/migrations/*{.ts,.js}'],
logging: true,
};

export const dataSource: DataSource = new DataSource({
type: 'postgres',
host: process.env.POSTGRES_URL,
port: parseInt(process.env.POSTGRES_PORT),
username: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
entities: [
'dist/src/entities/**/*{.ts,.js}',
],
database: 'postgres',
synchronize: false,
migrations: ['dist/src/migrations/*{.ts,.js}'],
logging: true,
});
dataSource.initialize().then(() => {
{
console.log('DataSource initialized');
}
});
Loading