I need my Project Ip for MongoAtlas. How can i get my project ip?
Depending on how Glitch projects are routed, you might be looking to find one of two IPs.
In order to get the IP of your project container, run curl https://ifconfig.me
in your project console. I don’t think this IP will be particularly useful as it seems project containers are inaccessible to the outside world (don’t quote me on this, however).
To get the IP of your project via your project’s URL, use the getent
utility as follows:
getent hosts fan-lupin.glitch.me
The utility should yield two different IP addresses. Both IPs seem to route similarly so I don’t think there is much of a difference in using one over the other, although I’m not quite sure.
Worked thanks
An add on to this question, does the IP change or is the project IP always the same. (Is it a static Ip?
Good question.
I’m not entirely sure if Glitch projects have static IPs. Without knowing, it can be reasonably concluded there’s no guarantee the IP won’t change; however, the URL can be relied on as something that will very rarely change, if at all (the only thing that will change the URL is if the project name changes). Depending on where the IP is being used in the application, it might make more sense to use the project URL.
I would make a new topic specifically for that question. The current thread is listed as having been resolved so it will likely fly under the radar for Glitch staff.
I think this post will answer your question