-
Notifications
You must be signed in to change notification settings - Fork 24
Support custom HTTP URL endpoint for handled Serializables, expose hyphenated URLs for CamelCase event names #188
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
Conversation
rdumusc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, I prefer having the second parameter as you did instead of a bunch more overloads.
zeroeq/http/server.h
Outdated
| * Handle PUT and GET for the given object. | ||
| * | ||
| * @param object the object to update and serve on receive() | ||
| * @param event uses this as the URL endpoint instead of the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be 'use', not 'uses'. I also don't find 'event' very clear, but I don't know have a good suggestion. maybe 'address' or something like 'httpPath'?
zeroeq/http/server.cpp
Outdated
|
|
||
| bool handlePUT( servus::Serializable& serializable ) | ||
| bool handlePUT( servus::Serializable& serializable, | ||
| const std::string& event ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/event/endpoint/
zeroeq/http/server.cpp
Outdated
| serializable.getSchema(), func ); | ||
| } | ||
|
|
||
| bool handleGET( std::string event, const std::string& schema, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endpoint
zeroeq/http/server.h
Outdated
| */ | ||
| ZEROEQHTTP_API bool handlePUT( servus::Serializable& object ); | ||
| ZEROEQHTTP_API bool handlePUT( servus::Serializable& object, | ||
| const std::string& event = std::string( )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overloads with (endpoint, object)
|
Updated |
zeroeq/http/server.h
Outdated
| * servus::Serializable::getTypeName() | ||
| */ | ||
| ZEROEQHTTP_API bool handleGET( const std::string& endpoint, | ||
| servus::Serializable& object ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ..& object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…phenated URLs for CamelCase event names
Use case:
I wasn't sure of creating (another!) overload for handle/handlePUT/handleGET with the customizable event name or what I did now with the default parameter to not break the API. Let me know what you prefer.