←back to thread

.localhost Domains

(inclouds.space)
301 points todsacerdoti | 2 comments | | HN request time: 0s | source
Show context
vlod ◴[] No.43644531[source]
Anyone care to shed why myapp.localhost:3000 (for the webapp I'm developing) is something that's useful for me rather than localhost:3000 ?

EDIT: on linux and don't use launchd, so I'd still the port number

replies(8): >>43644573 #>>43644584 #>>43644588 #>>43644599 #>>43644601 #>>43644606 #>>43644652 #>>43645096 #
1. cyral ◴[] No.43645096[source]
Note the use of the Caddy webserver (you could also use nginx or whatever), which proxies to the port, so it's just myapp.localhost. I like this because it mirrors our production site. We can have subdomain.myapp.localhost and subdomain.myapp.com so links and everything work properly in both environments (assuming you have an env variable for the base domain)
replies(1): >>43645259 #
2. oulipo ◴[] No.43645259[source]
Could there be a way to setup the Caddy server dynamically using eg direnv so that it's only launched when I'm in my dev folder?