Medim
Explore posts from serversUse prisma globally in api routes
I have a question, is it possible to use the prisma client globally without having to import it everytime? I'm using Prisma + Turso so there's a bit more than just two lines of code to use the prisma client so adding it to every api file is a bit tiring, is there a way to make it available as a util/helper globally?
what is the best way to do it?
4 replies
Need some explanation on templates
Hi there! I'm working on multiple templates (mainly CMS's) for railway, and I saw that some templates are maintained on a Railway repo (https://github.com/railwayapp-templates) and some are user hosted (mine is user hosted), why?
Is it because some templates are widely used and would be better assigned to a railway team member to maintain it?
Or is there a way I can put my templates there too?
12 replies
Issue with env vars using webpack
Hi there!
I'm trying to deploy a Vue2 project using vue-cli.
To access my env vars on client-side code i need to use
process.env.VUE_APP_MYVAR
But on railway, everything returns undefined
?
Its gets my process.env.NODE_ENV
var, but it doesnt get my other vars.
Tried using webpack-dotenv
to expose system vars too, but the rest of my vars still undefined.
What could it be? Webpack messing it up? On AWS worked fine.4 replies
Issues using Nginx to reverse proxy
Hey there! I'm in the process of migrating some of my company projects to Railway but i'm having some issues setting up PHP-FPM.
PHP-FPM needs a nginx reverse proxy with Fastcgi to be able to serve files.
Ok... I did that! My PHP-FPM is live and accepting connections, I generated a domain and directed Nginx to it.
My API also is able to reach Nginx just fine.
The flow is simple:
API -> NGINX -> PHP-FPM API
But currently, all my requests time out at the PHP-FPM API.
Log from Nginx:
This is my default.conf file:
(I will regenerate domains after this get fixed so no worries)
What could it be?
438 replies
Bug while deploying templates
Hi there! was about to record a video to get some examples for a feature request i'm about to do and encoutered this error, while railway is setting up your template you can't access settings and if you do, it'll crash the deployment???
4 replies