Join Slack
Powered by
Hello how do you have use prisma in an express rou...
# orm-help
o
Olawale Mayor
06/22/2022, 7:08 PM
Hello how do you have use prisma in an express router?
✅ 1
Olawale Mayor
06/22/2022, 7:35 PM
Do I have to create a connection in every route?
a
Austin
06/22/2022, 8:24 PM
Hey Olawale! We have a ready to use Express example
here
. You should not create a connection in every route, you should create the
PrismaClient
once and reuse it 👍.
o
Olawale Mayor
06/22/2022, 8:30 PM
The example does not use a router, I have found a solution here
https://www.prisma.io/docs/guides/performance-and-optimization/connection-management#prismaclient-in-long-running-applications
4
Views
Open in Slack
Previous
Next