Test wildcard domains


#1

Hi, I am trying to test my express app with vhost for subdomain support. The issue is that the /etc/hosts file does not support regex to route say *.localhost.com to 127.0.0.1. I installed the popular dns server dnsmasq to acquire regex support but I am unable to get it working, and I believe it has to do with the lack of a proper configuration. The dnsmasq address flag was enabled and set to /localhost/127.0.0.1, I then created an entry within /etc/host 127.0.0.1 *.localhost.com and then in my app I’m listening on process.env.PORT and process.env.IP but no requests show up.


#2

You do not need to reconfigure localhost since your project still runs on <username>-<projectname>.c9.io
Her’s an example of using subdomains with node http server How to host multiple websites in one server