crab icon indicating copy to clipboard operation
crab copied to clipboard

Output current route (VIRTUAL_HOST) when starting a routable process

Open JakeSidSmith opened this issue 5 years ago • 3 comments

It'd be nice if this were output in the terminal, as currently it only states the default http://127.0.0.1:8080/, this way users can click-through to the app they're running.

JakeSidSmith avatar Feb 12 '20 12:02 JakeSidSmith

Making it print the current state of the router would be simple enough, but what does it provide? If the user starts their project then the router, the list is out of date. Starting/restarting projects after the router has started also leads to an out of date list.

Printing the assigned route when a project starts (ie crab web) might be more useful and make going to a project easier?

RealOrangeOne avatar Feb 12 '20 15:02 RealOrangeOne

Is the router not project specific? If not, I guess web would work fine.

JakeSidSmith avatar Feb 12 '20 15:02 JakeSidSmith

Correct, There's 1 crab router, which handles routing traffic from the given port to the specific project.

A process is routable if it's got a $VIRTUAL_HOST and has been allocated a port when it's executed. crab could print the allocated $VIRTUAL_HOST in that situation, which should be simple enough. The log message would need to be clearly not a part of the underlying application, which may be tricky, but not impossible.

RealOrangeOne avatar Feb 12 '20 15:02 RealOrangeOne