-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add an on() function to ESP8266 Webserver that supports startsWith #2019
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
Comments
Well it isn't supposed to be a real link but an example of what I am using 2016-05-11 21:26 GMT+02:00 Robert [email protected]:
|
yes i know now :) didn't read it right. pretty nice function to have. |
I have some experimental code that makes it possible to create a
The While this is working for me, I think there is some room for optimization so that the path segments do not need to be parsed individually by each handler. I think that the server should first check all of the static paths for matches and then, if no match is found, the URI can be separated into segments and the dynamic paths can be checked. |
Would be nice and cleaner to be able to aloate function only for serving files per path preferences... like [ip]/scripts/{something_goes_here} to pass full uri to a handler for anything under "scripts" .. and than determine if it fulfills our criteria and what to do with it.. fetch from eprom or not... etc... |
Hope this will make it in the next milestone. It's sorely missing. |
There are some VERY hairy issues being investigated that are much higher priority than this. To help, I encourage anyone who needs this to make a PR. |
There are 3 possible solutions here, and choosing which must be done carefully, because once released and adopted by users, there's no switching later. Which solution to adopt requires further discussion, so pushing this back. |
What about optionally providing a wildcard provider object? The default could be glob and this would allow flexibility for other wildcarding. Edit: the default should be whatever uses the fewest resources in operation. |
@liebman Something along those lines did cross my mind, I.e.: have a functor provide the match functionality, like a policy class. However, RequestHandlerImpl must be kept in mind. |
There are several proposals here, and they require evaluation (e.g.: bin size). |
I generally like the Regex idea, but it might be a bad idea in an embedded context, as Regex parsers usually are not that small in binary size. But considering some targets have enough code space to fit a Regex parser without impacting the code footprint significantly, I second that idea. |
#6696 is merged, closing. |
Hello!
Having a way to pass paramters via URL seems like a very important thing to have and I think a on() handler that uses startsWith should therefore be added.
As this was essential in one of my projects, I did the changes to my local copy of the esp8266webserver library but I really strongly suggest adding this feature to allow for more interactive websites and easier programming of things like: http://esp8266.local/configure/mdns_name/this_is_my_new_name and similar use cases like passing strings via the url.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: