Skip to content

About the find method #23

@3imed-jaberi

Description

@3imed-jaberi

Hi @fundon,
I was created a Router for Koa based on Trek-Router.

I want to support 405 method not allowed and 501 path not implemented as you can see here but I can't do that with the current result of find method because we don't have any indicator about path was finded or not.

So, if there is any other way to get what I ask. or please add something added to result to be like that;

  const route = TrekRouter.find(method, path)
  const [handler, params, findedPath] = route

  // !handler && findedPath === false => 501 path not implemented.
  // !handler && findedPath === true => 405 method not allowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions