Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gangway

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gangway - npm Package Versions

234

3.0.0-rc.1

Diff

greypants
published 3.0.0-rc •

nhunzaker
published 2.2.0 •

Changelog

Source

2.2.0

  • Gangway will not send a body unless it is specified. Before this version, it would default to an empty object.
nhunzaker
published 2.1.0 •

Changelog

Source

2.1.0

  • Upgrade superagent to 1.8.x
  • Add buildQuery option to define custom query string behavior
nhunzaker
published 2.0.0 •

Changelog

Source

2.0.0

  • Endpoint invocations now return a promise-like interface with then, catch, and done methods. then and catch return true promises. The intention is to allow for access to the underlying superagent request while still exposing promise functionality.
  • Promises are not included by default. If not polyfilled, use the Promise option to provide the Promise implementation to use for Gangway.
  • route now operates one step shallower. See README for usage.
  • routes now respect relative URLs. Absolute urls will operate from the base path.
  • Added a request timeout option. This option defaults to 15 seconds.

Upgrading

If you are upgrading from 1.0, there are a couple of necessary changes:

Promises

If a global Promise object is not found, Gangway will throw an error. To eliminate this error, provide a Promise library to Gangway:

var Promise = require('promise')

Gangway({
  Promise: Promise
})
Routes

The two-level approach to declaring routes has been removed. The following patterns should be switched out:

// OLD
API.route({
    users: {
        get: {
            path: '/users'
        }
    }
})

// NEW (correct)
API.namespace('users').route{
    get: {
        path:'/users'
    }
}}
Relative routes

Routes without a / at the beginning will resolve to their namespace. Check to ensure that your paths are resolving correctly for your endpoints if you use absolute paths.

nhunzaker
published 2.0.0-rc •

nhunzaker
published 2.0.0-alpha-3 •

nhunzaker
published 2.0.0-alpha-2 •

nhunzaker
published 2.0.0-alpha •

nhunzaker
published 1.4.0 •

Changelog

Source

1.4.0

  • Added `Accept: "application/json" default header
  • Internal change: remove dependency on inflection library.
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc