rest-url
v0.0.4
Published
Makes REST urls
Downloads
8
Readme
rest-url
Makes a RESTful url from an endpoint and params
An endpoint looks like http://foo/:bar/:moo
:bar
and :moo
will be replaced by matching params.
params not found in the endpoint will be added
on the end as query params.
In other words
var restUrl = require('rest-url');
restUrl.make("http://foo/:bar/:moo", {
bar: "aaa",
moo: "bbb",
pow: "what",
ya: "a b",
});
returns
http://foo/aaa/bbb?pow=what&ya=a%20b