This is a connect (or express) middleware that adds the urlgrey
url-querying and manipulation library to your request object (using the current request url). It's available as
req.uri by default, but you can override the
var app = connect;appuseurlgreyConnect;appuseresend"the path is: " requripath;;httpcreateServerapplisten3000;
appuseurlgreyConnect"http"; // all links will be http
var// always takes a request as its only parameterreturn reqheaders'x-forwarded-proto' ||reqheaders'x-forwarded-protocol' ||'http';;appuseurlgreyConnectprotocolFunction "othername";/* the protocol for all links will depend on the headersin the request object. */
appuseurlgreyConnect"http" "othername"; // it will be available as req.othername
See the urlgrey docs for urlgrey usage.