Updated solution to support alternate URLs

Replaced hard-coded 127.0.0.1 with location.origin, so that it would be possible to use either localhost or 127.0.0.1 to access the app.