Hello, I'm trying to know which port the service i...
# ask-for-help
v
Hello, I'm trying to know which port the service is listening to from the svc.on_startup hook, I've tried a number of things but none worked, any idea on how I could do that?
c
what’s the reason you need to know the port?
The default is 3000 but user can override that
v
It's a bit of an edge case, I am trying to make an endpoint that returns an url to the service itself. (we're getting ip from env but it makes sense to get port from the process) I ended up grabbing it from the BentoMLContainer (which is an internal) as I couldn't get it with solutions recommended for uvicorn/starlette. I haven't tested yet that the one gotten from BentoMLContainer is always right in production but it was fine in my local tests.