UNPKG

node-prisma-structure

Version:

A Node.js API structure using Prisma ORM for scalable and modular development. This package includes a complete authentication API (signup, login, logout, password reset, and token-based authentication) and provides a well-organized directory structure fo

17 lines (11 loc) 405 B
const { PrismaClient } = require('@prisma/client'); var globalForPrisma = global.globalForPrisma || {}; const prisma = globalForPrisma.prisma || new PrismaClient(); globalForPrisma.prisma = prisma; global.globalForPrisma = globalForPrisma; process.on('SIGINT', async () => { await prisma.$disconnect(); console.log('process exit called'); process.exit(); }); module.exports = { prisma };