How to get the full URL for a request in Hapi
问题 In my hapijs app, given a Request object, how can I find the original, unparsed, unmodified URL? function getRequestUrl (request) { return ...; // What goes here? } I've found that I can piece it together somewhat from Request.info.host , Request.path , and Request.query , but it lacks the scheme (ie, http vs https), and is a bit of a kludge. Isn't the plain URL available somewhere? 回答1: The full URL isn't stored somewhere you can get it. You need to build it yourself from the parts: const