R
Railway

✋|help

Sync service hostname to environment variable with Vercel

Jjasonaa8/31/2023
Is it possible to take the hostname of a given service and push it into an environment variable on a Vercel project? I see that environment variables sync from Railway to a linked Vercel project if you enable Railway's Vercel integration, so I tried to create an environment variable with as in the screenshot, but this didn't work as I expected (an env var was made on Vercel but it was empty).

The goal is to access an API service deployed in a PR environment on Railway, from the frontend preview deployment on Vercel, so the frontend uses the PR's instance of the API instead of using our prod/staging instance.

Would appreciate any pointers on how to achieve this
Jjasonaa8/31/2023
3a7cb6bb-8dc2-4a24-9308-522c7ed2812c
BBrody8/31/2023
can you show the value of the variable in railways ui that shows up empty on vercel?
Jjasonaa8/31/2023
oops totally forgot to add that
Jjasonaa8/31/2023
Jjasonaa8/31/2023
https://docs.railway.app/develop/variables#railway-provided-variables is what I got the railway vars from, although i may be misunderstanding how this is supposed to work
BBrody8/31/2023
it seems like variables arent being rendered before being sent to vercel, everything you are doing looks good to me
DDuchess8/31/2023
Thread has been flagged to Railway team by @Brody.
Jjasonaa8/31/2023
gotcha, appreciate the 2nd set of eyes! i'll see if i can setup a webhook to make this work
Jjasonaa8/31/2023
to confirm your hypothesis - NIXPACKS_PYTHON_VERSION is empty on Vercel, but should be pulling from a shared variable on Railway that is not empty
BBrody8/31/2023
any reason why you have a shared variable when theres only one service lol?
Jjasonaa8/31/2023
there used to be 2 services in there haha
BBrody8/31/2023
fair enough

Looking for more? Join the community!

Recommended Posts
Bot TelegramHi i want to ask if is possible to deploy a telegram bot in railway, because i read that mirrors/useApplication failed to respondHello, I just bought the Hobby Plan and I tried to deploy an Express app I made, the issue is the sevm.max_map_count [65530] is too low during deployementHi everyone, I currently try to deploy a SonarQube application on Railway and during deployement, I Errors Installing Cal.com TemplateHello, I am running into issues installing the cal template. Error: `ERROR: failed to solve: procIs private networking down?Hey is private networking down or something? Because currently all my builds are crashing because thHow to save a bit in MySQL database?I am trying to put data in my table in SQL, but whenever I come across bit, the table does not accepRunning Sqlite migrate with prisma in railwayHi, so im trying to use Sqlite database with prisma in railway, i got this error, any clue with thisAngular SSRI'm planning to deploy an angular app with server side rendering. Does Railway support it? At the moKilled Errorhello can somebody help me with this its not starting my projectTerrafoam thingyMy friend told me to learn terrafoarm(this sounds wrong i forgot what its called) Anyway what does iDocker Build Error``` ============== Using Nixpacks ============== context: 009fc5728ee64eb7a597ef6570e251a0 ╔making linux program available in nixpacksHi, I want to run a golang app on railway. Within this app i use the following dependency https://giIs it normal for a deployment to be initializing this long?https://cdn.fl1nt.dev/GAGE1/YAdogAtO61.png I don't think this is normal, none of my deployments takUpdating N8N Service Via Railway CLIHello, I created a Railway project and installed N8N via a Railway template. The version I am on is Ephemeral storage concernHi I want to do programmatic NPM publishes using a Railway service I will need to basically use shelredploy after pushin to github not working anymoreit stopped to redeploy my appProject failing to deploy - 'no space available'Project: 13b3222b-eb44-433c-ad71-9174aa430a7d Has been deploying fine but started to complain about"Waiting" to deploy for 18 hours? Am I doing something wrong?I'm trying to move an app I deployed personally to a new account by setting up a new account and newQ: Help with Deploying a Medusa Server to RailwaySo, it keeps saying server crashed, but in the logs, nothing seems to be an issue. Been at it backHow do i move my project under the pro plan i just moved to?I just migrated from hobby to Pro - how do i move my projects under this? it says i need an active s