Skip to content

New API for specifying http method #43

Description

@wesleytodd

Starting with a discussion in #41, we need to come up with a new api for specifying the http method[s] for a handler. Here are a few examples:

  1. router.methods('GET', 'POST').use('/', function () {});
  2. router.use(['GET', 'POST'], '/', function () {})
  3. router.route('/').methods('GET', 'POST').handler(function () {})
  4. router.route(['GET', 'POST'], '/').handler(function () {})

All of these are fairly consistent from the current API in my opinion, despite being breaking changes in a few cases. Numbers 1 & 3 are not breaking changes AFAIK since they are just adding new methods. Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions