Changed hardcoded localhost to use the request.host