-
Notifications
You must be signed in to change notification settings - Fork 47
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
Give An Example of Request Routing In The Server #13
Comments
Have look at the tests, e.g. https://github.com/gotthardp/gen_coap/blob/master/test/simple_storage_tests.erl. |
If there is a handler1 for /A and handler2 for /A/B... - how do you actually add I came up with something like:
but they are all calling the same handler called Also, what does One additional question but very important: if I have a URL like:
where B is varaible (can change - for example |
The I don't think the last parameter of To catch BTW, the _Query in |
Hello,
would it be possible to add a small example that explains the request routing in the server and acceding to an appropriate handler for a given URI path.
Currently we have this: https://github.com/gotthardp/gen_coap/blob/master/examples/src/sample_server.erl, and we can figure out if the type of req was GET, POST, PUT, ..., but I see no information how we parse URL string and based on this we call an appropriate handler for this API endpoint.
In general, I would like to understand the CoAP req multiplexer (router) and I would like to see something like this: https://github.com/go-zoo/bone/blob/master/example/001/example.go#L34-L38 as a framework that would enable quick development of the API.
The text was updated successfully, but these errors were encountered: