how to ref domain from another service?

2 years ago

need to get a specific domain from a service in my project into a variable called CORS_ORIGIN. I know that I can use the RAILWAY_SERVICE_*SERVICE_NAME*_URL but i need to use the CORS_ORIGIN instead, is there any ${{ }} variable that can help me do that?.

Closed

16 Replies

2 years ago

N/A


2 years ago

something like this?

CORS_ORIGIN=${{ServiceName.RAILWAY_PUBLIC_DOMAIN}}

2 years ago

yep, that works?


2 years ago

yep!


2 years ago

will try it out, give me a minute


2 years ago


2 years ago

im guessing its only available at runtime?


2 years ago

no, you can reference the domain at the service level


2 years ago

so it would appear at build time?


2 years ago

yes it would be available at build time


2 years ago

just because im getting some errors with a env validator that i've and im guessing that i would need to move it to runtime


2 years ago

hmmmm


2 years ago

are you building with a dockerfile?


2 years ago

yep, arg and env then?


2 years ago

just ARG


2 years ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...