kickstart-express
Version:
A powerful CLI tool to quickly scaffold Express.js projects with modern tooling and best practices
15 lines (12 loc) • 354 B
text/typescript
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
const connectDB = async (): Promise<void> => {
try {
await prisma.$connect();
console.log('PostgreSQL connected via Prisma');
} catch (error) {
console.error('Database connection error:', error);
process.exit(1);
}
};
export { prisma, connectDB };