how to ref domain from another service?

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?.
15 Replies
Percy
Percy2mo ago
Project ID: N/A
ThallesComH
ThallesComHOP2mo ago
N/A
Fragly
Fragly2mo ago
something like this?
CORS_ORIGIN=${{ServiceName.RAILWAY_PUBLIC_DOMAIN}}
CORS_ORIGIN=${{ServiceName.RAILWAY_PUBLIC_DOMAIN}}
ThallesComH
ThallesComHOP2mo ago
yep, that works?
Fragly
Fragly2mo ago
yep!
ThallesComH
ThallesComHOP2mo ago
will try it out, give me a minute
ThallesComH
ThallesComHOP2mo ago
im guessing its only available at runtime?
Brody
Brody2mo ago
no, you can reference the domain at the service level
ThallesComH
ThallesComHOP2mo ago
so it would appear at build time?
Brody
Brody2mo ago
yes it would be available at build time
ThallesComH
ThallesComHOP2mo 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 hmmmm
Brody
Brody2mo ago
are you building with a dockerfile?
ThallesComH
ThallesComHOP2mo ago
yep, arg and env then?
Want results from more Discord servers?
Add your server