peterldowns / localias

custom local domain aliases for local dev servers
MIT License
605 stars 3 forks source link

Direct integrations with npm (pnpm specifically) to automatically create a local domain when a server is run #14

Closed AnishDe12020 closed 1 year ago

AnishDe12020 commented 1 year ago

Example - localias serve frontend.test -- pnpm dev. Ideally it would be awesome if localias could grab the port on which the server is starting and assign the local domain but alternatively specifying the port also should work. After the command exits/is interrupted, the local domain can be removed

I can give this a try but the last time I touched Go was 2 years back so gonna need some help lol

peterldowns commented 1 year ago

Hey Anish, thanks for the suggestion and the offer to attempt implementing. This kind of process management is something that Chalet/Hotel did that I explicitly do not want to add to Localias.

My vision is for Localias to be a standalone tool that manages the proxying relationship between a domain and a local port, and for Localias to be able to easily switch between different sets of these aliases with a .localias.yaml config file in each project you're working on. Keeping processes running and restarting them correctly on failure, with the correct environment, while allowing you to debug and access logs, etc., is tricky to do well. Especially when Localias can be daemonized and configurations can be switched on the fly, I'm not sure how to guarantee a good user experience. I think it's best for Localias to only manage the proxy server layer.

I recommend configuring your dev server to run on a consistent port and configuring an alias that references that port.