Socket
Socket
Sign inDemoInstall

gangway

Package Overview
Dependencies
22
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
Previous134Next

1.4.0-rc

Diff

nhunzaker
published 1.3.1 •

Changelog

Source

1.3.1

  • Fixed critical issue with nested resources where their paths failed to properly construct.
nhunzaker
published 1.3.0 •

Changelog

Source

1.3.0 (Deprecated, see 1.3.1)

What's new

  • The baseURL configuration option now defaults to /.
  • The baseURL configuration option is no longer a required option.
  • ::resource returns a namespaced version of the API.
  • ::resource accepts function as a third argument. This function is invoked with a namespaced version of the Gangway instance that operates under the provided key.

This version adds namespacing to Gangway. The following is now possible:

var API = Gangway()

// This will create CRUD routes for `/users` and `/users/{user_id}/articles`
API.resource('users', {}, function (users) {
    users.resource('articles')
})

Upgrading

Those chaining off of ::resource should update their code to reflect the change in the returned value. This returned value is a namespaced version of the Gangway instance that operates on the key given as the first argument.

Old
var API = Gangway()

API.resource('users')
   .resource('posts')
New
var API = Gangway()

API.resource('users')
API.resource('posts')
nhunzaker
published 1.2.0 •

Changelog

Source

1.2.0

  • Upgraded superagent to ~1.7.
nhunzaker
published 1.1.2 •

Changelog

Source

1.1.2

  • Resource CREATE operation should post to resource root path
nhunzaker
published 1.1.1 •

Changelog

Source

1.1.1

  • Resource READ operation should use optional id parameter
nhunzaker
published 1.1.0 •

Changelog

Source

1.1.0

  • Add resource API as shorthand for RESTful resources
nhunzaker
published 1.0.1 •

Changelog

Source

1.0.1

  • Fix bug where undefined config would throw off options preparation
nhunzaker
published 1.0.0 •

Changelog

Source

1.0.0

  • headers, query, body, and params options are now merged together.
nhunzaker
published 0.13.0 •

Changelog

Source

0.13.0

  • Internal change to eliminate the dependency of Function.prototype.bind.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc