12 lines
324 B
TypeScript
12 lines
324 B
TypeScript
import { createConnection } from 'typeorm';
|
|
|
|
export const connectDB = async () => {
|
|
try {
|
|
await createConnection();
|
|
console.log('База данных подключена');
|
|
} catch (error) {
|
|
console.error('Ошибка подключения к базе данных:', error);
|
|
process.exit(1);
|
|
}
|
|
};
|