stacker.news/api/models/index.js

15 lines
336 B
JavaScript
Raw Normal View History

import createPrisma from '@/lib/create-prisma'
2021-03-25 19:29:24 +00:00
2022-04-27 22:06:42 +00:00
const prisma = global.prisma || (() => {
console.log('initing prisma')
return createPrisma({
connectionParams: {
connection_limit: process.env.DB_APP_CONNECTION_LIMIT
}
})
2022-04-27 22:06:42 +00:00
})()
2021-03-25 19:29:24 +00:00
2022-04-27 22:06:42 +00:00
if (process.env.NODE_ENV === 'development') global.prisma = prisma
export default prisma