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:Jump to 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...
8 Replies
Project ID:
N/A
N/A
To be honest this feels more like an XY question, so can you tell me the usecase?
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.
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.
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
thank you for asking, but please say what you need to here
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