You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
does the SDK support a routes with a parameter similar to node js does , using : id in a path:
app.post('/api/session', sessions.post);
app.get('/api/session/:id', sessions.get);
app.put('/api/session/:id', sessions.put);
app.delete('/api/session/:id', sessions.delete);
The text was updated successfully, but these errors were encountered:
Unfortunately, there is no router in place. I've been looking into this myself.
I think what I'm going to ultimately do is make my own router and then see if MS wants in on it. Keep in mind, they're not going 100% for their http_listener as the library is focused on service-consumption first and foremost.
However, the library is basically useless without the http_listener so we kind of have to patch it ourselves.
I figured, the easiest way to make a router would be to use Boost's property_tree data structure and parse the relative URIs for each http_request that comes in.
Also, Express.js has convinced me, regexes in routers need to die! Instead, I'm opting to design routes with default handlers instead of this regex nonsense :P
I have a router patched into the http_listener for a project I am working on. As I have some code supporting this I'd like to have some details for specific keypoints I could directly build into.
Currently it is just a basic std::map<utility::string_t, utility::string_t> that contains all values of the parameterized URI. To register it right you give URIs like in the example from @amigo421 . But I tend to rewrite it as a decorator to the existing code.
does the SDK support a routes with a parameter similar to node js does , using : id in a path:
app.post('/api/session', sessions.post);
app.get('/api/session/:id', sessions.get);
app.put('/api/session/:id', sessions.put);
app.delete('/api/session/:id', sessions.delete);
The text was updated successfully, but these errors were encountered: