Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove /custom subpath for endpoints and add a way to customize the endpoint subpath #7695

Merged
merged 2 commits into from
Aug 30, 2021

Conversation

nickrum
Copy link
Member

@nickrum nickrum commented Aug 30, 2021

Notice: This drops the /custom/ prefix for custom endpoint modules. Please update your projects logic if you rely on custom endpoints.


When using

export default router => {
  ...
};

to register a custom endpoint, it will now be registered at /<extension-name>.

This adds another way to register an endpoint:

export default {
  id: 'some-id',
  handler: router => {
    ...
  }
};

This endpoint will be registered at /some-id.

@nickrum nickrum self-assigned this Aug 30, 2021
@rijkvanzanten rijkvanzanten added this to the v9.0.0-rc.92 milestone Aug 30, 2021
@rijkvanzanten rijkvanzanten merged commit 6286edf into main Aug 30, 2021
@rijkvanzanten rijkvanzanten deleted the imp/endpoint-custom-path branch August 30, 2021 14:09
@joselcvarela
Copy link
Member

What were the motivation for this?

I can see many users complaining about their custom routes not working because they are registering an already in use endpoint which is causing conflicts.

@tylerforesthauser
Copy link
Contributor

If this PR allows one to nest custom endpoints in directories, the simple solution would be to structure your directory like endpoints/custom/my-endpoint/index.js.

@rijkvanzanten
Copy link
Member

@joselcvarela You're right about that, and this is the sort of breaking change that we really don't want to make.. Once v9 is released in production. The reason we're still in RC right now is to make sure we get all these last (small) breaking changes out of the way before we're locked in

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants