How to get projectId, environmentId, and serviceId programmatically

Inside a server I have running, I need to upsert an environment variable to the server it runs on. But I don't have the projectId, environmentId, and serviceId to do so. How can I get this information inside the server to make the request to upsert an environment variable?
Solution:
no we do not have limitations in that regard, we have a few users with hundreds of services on their canvases, but that creates an absolutely horrible experience since the canvas style is not designed for such use cases. Please invest your time into creating a multi-tenant telegram bot, your time would be better spent doing that then figuring out how to hook into Railway's API, or worse yet, setting up k8s...
Jump to solution
8 Replies
Percy
Percy4w ago
Project ID: N/A
Jacob Devore
Jacob Devore4w ago
N/A
Brody
Brody4w ago
To be honest this feels more like an XY question, so can you tell me the usecase?
Jacob Devore
Jacob Devore4w ago
I was going to store a session for a user logging into a server. These sessions are kept almost indefinitely, so was going to store them as environment variables. But can just store in a database somewhere, no problem But now that I have you here, I have another question. I will be spinning up a server per user and will use the Public API to do that. How would I create a project connected to a Github Repo with specific environment variables and allow public networking on a specific port? Are the public network domains predictable? Meaning I will need to access each user's server through the public network (it's an API), and I will need to be able to predict, if possible, the URL for each project. Ideally, I can create everything in 1 request, as I see the rate limiting is 1000 requests per hour.
Brody
Brody4w ago
100% store sessions in a database and not environment variables. As for spinning up a Railway service for every user, I can not recommend enough for you to not do that, It will not be scalable in the slightest, even if you can do it in a single request. Please look into writing a multi-tenant app instead.
Jacob Devore
Jacob Devore4w ago
Will get back to you on this Is it okay if I send you a DM @Brody? Have a couple questions regarding this and would prefer not to mention our use case here
Brody
Brody4w ago
thank you for asking, but please say what you need to here
Solution
Brody
Brody4w ago
no we do not have limitations in that regard, we have a few users with hundreds of services on their canvases, but that creates an absolutely horrible experience since the canvas style is not designed for such use cases. Please invest your time into creating a multi-tenant telegram bot, your time would be better spent doing that then figuring out how to hook into Railway's API, or worse yet, setting up k8s
Want results from more Discord servers?
Add your server