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

Add new node kinds #27

Open
fundon opened this issue Sep 26, 2022 · 5 comments
Open

Add new node kinds #27

fundon opened this issue Sep 26, 2022 · 5 comments

Comments

@fundon
Copy link
Member

fundon commented Sep 26, 2022

  • Regex: supports regex on parameter
  • Root?: allow '' empty str at top of the tree, replace /
@fundon
Copy link
Member Author

fundon commented Sep 27, 2022

:name([0-9]+)

@mbodmer
Copy link
Contributor

mbodmer commented Jun 6, 2024

For my MQTT usecase I have shared here: #41 (comment) there would be the need to have a wildcard which excludes the trailing / when matching.

I have used a named wildcard like this: MQTT/multilevel/:value*.

this matches topics like:

MQTT/multilevel/ -> value: ""
MQTT/multilevel/a -> value: "a"
MQTT/multilevel/a/b -> value: "a/b"

and so on, but the MQTT specification also requires matching of:

MQTT/multilevel

which would result in including the / in the values above and MQTT/multilevel would be the empty string.

This was and is still "good enough" for me, but it would be nice to have a dedicated matcher or option for this usecase also.

@mbodmer
Copy link
Contributor

mbodmer commented Jun 6, 2024

Another nice thing would be an optional "root node", which would allow having routes which don't need a common first character.

@fundon
Copy link
Member Author

fundon commented Jun 6, 2024

Another nice thing would be an optional "root node", which would allow having routes which don't need a common first character.

This was supported in very early versions.

This was and is still "good enough" for me, but it would be nice to have a dedicated matcher or option for this usecase also

I will consider adding this feature.

@mbodmer
Copy link
Contributor

mbodmer commented Jun 6, 2024

I know MQTT is not the intended use case, but since the router is very versatile it almost supports it :-) so i just wanted to drop it here for reference. Of course it is up to you to decide the future direction of the project.

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

No branches or pull requests

2 participants