I've used[0] `.local` to achieve something like this, by advertising service endpoints over mDNS.
Exposing random services to your local network is exactly what mDNS is for, I always thought it was a shame more dev tooling didn't do that.
[0]: https://github.com/andrewaylett/mod_bonjour is a fork of Apple's mod_bonjour, very much unloved of late I'm afraid.