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

feat!: add support for routes passed in as arrays #58

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

Megapixel99
Copy link
Collaborator

Express natively supports passing multiple paths into the same function as an array as seen in the file test/_routes.js. This PR adds support for passing multiple paths.

This PR was made under the assumption the array of paths would not include regex expressions, and the code may break if the array of paths has a regex expression in it (as of the creation of this PR). I do not believe this will be a common use case; however, it is still possible.

Copy link
Owner

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, yeah I remember when I was originally writing this and decided not to support this at the time but I knew it was a gap. I agree that this is a less used feature (even if you look at wider express usage it is relatively low) and that going for perfect is probably not worth it until someone comes asking.

IIRC there is one other pending PR that I have just been too busy to circle back on, but maybe we can get a release prepend with this and that?

@Megapixel99
Copy link
Collaborator Author

Yep this PR: #54 is still open. The other issues related to PR #54 are typescript related which I have very little experience with though so I have not looked into them.

@wesleytodd
Copy link
Owner

Ah ok yeah I think i was misremembering that there was something else. Looks like we can merge this then!

@wesleytodd wesleytodd merged commit f2e054e into release/v1.0.0 Jan 19, 2024
6 checks passed
@wesleytodd wesleytodd deleted the support-array-paths branch January 19, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants