Skip to content

greggman/rest-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rest-url

Makes a RESTful url from an endpoint and params

Build Status

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

About

Makes REST urls

Resources

Stars

Watchers

Forks

Packages

No packages published