Testing Mojolicious locally


So you have coded your newest web system in Mojolicious and would like to test it in an environment where it "thinks" it's running on the actual webserver, even though it's still running on your machine.

Add your www.example.com entry to point to in /etc/hosts and then redirect your localhost's port 80 to port 3000:

sudo iptables -t nat -I OUTPUT -p tcp     -d --dport 80     -j REDIRECT --to-ports 3000

No need to run as root!