New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

resturlify

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resturlify

Consistently generate restful urls

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

RestUrlify

Consistently Generate Rest URLs

Why?

I wrote this to help transition my team from an RPC-each-call-a-snowflake tendency to REST.

Use Anywhere

This library works in the client and on the server.

Install

bower install resturlify

Or

npm install resturlify

Examples

Constructor

var urlTools = new RestUrlify("http://www.web.com/api");

Simple

urlTools.buildUrl()

Returns: http://www.web.com/api

With Params

urlTools.buildUrl({ 
  resource: 'resource',
  query: {id : 1}
})

Returns: http://www.web.com/api/resource?id=1

Custom Methods

urlTools.buildUrl({
  resource: 'resource',
  id: 1,
  customMethod: 'approve'
})

Returns: http://www.web.com/api/resource/1/approve

Keywords

REST

FAQs

Package last updated on 14 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts