Added swagger and config read

This commit is contained in:
2023-11-18 02:00:33 +03:00
parent 841e9955bf
commit dd33571463
3 changed files with 37 additions and 2 deletions

20
backend/config/index.ts Normal file
View File

@@ -0,0 +1,20 @@
import { config as configInit } from 'dotenv';
configInit();
export const config = {
database: {
type: 'postgres',
host: process.env.DATABASE_HOST || 'localhost',
port: +process.env.DATABASE_PORT || 5432,
username: process.env.DATABASE_USERNAME || 'postgres',
password: process.env.DATABASE_PASSWORD || '',
database: process.env.DATABASE_DB || 'bot_db',
synchronize: true,
logging: false,
autoLoadEntities: true,
},
server: {
port: +process.env.SERVER_PORT || 8080,
},
};