To avoid hard-coding server url you can use "https://" + request.host + "/r/"