How to authenticate Prisma Optimize in a VPS ?
Hi everyone. I enabled Prisma Optimize on a project to try it out. On local, I can authenticate using the browser, all works well.
On a VPS though, I pushed to prod and my website crashed.
How can we authenticate to Prisma on a VPS ? What command could I run before hand to avoid this issue ?
I have a production and a preproduction environment, do I need to authenticate for both, or only for one ? Do we need to run this command inside the project, alongside the schema.prisma ?
Thanks !
6 Replies
So here's what I did :
Installed xdg-utils because you apparently need it to run the command
Then it successfully kept the CLI running and sent me a link, redirecting to
127.0.0.1
. Except I'd like to connect to my VPS server.
So I replaced 127.0.0.1
with server IP, but I could not access it.
I'm using EC2 on AWS with security groups allowing connections from all ports.
But I'm using Caddy Server, which apparently does not allow any connection not configured in its config file.
Since the port changes everytime I ran the command, I cannot predict in advance the port to open.Hey @Virgile 👋
Thank you for trying out Prisma Optimize.
At the moment, Prisma Optimize is supposed to be used in local development only. It isn't designed to use in production environment yet. Though, this is in our plans and we will support using it in production environments as well.
thank you for replying 🙂
No worries! 😄
Alright it does not seem to work in my project. Using NestJS with a service
I've tried using it directly before calling a resource, like
this.prisma.$extends(withOptimize()).users.findMany()
. It's getting me the users, showing console.logs to preview the data.
But there is no data in the dashboardIs your repository open source?
Any way I can run this?