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

Logging/Middle-ware support? #49

Open
trey-c opened this issue Jun 9, 2020 · 2 comments
Open

Logging/Middle-ware support? #49

trey-c opened this issue Jun 9, 2020 · 2 comments

Comments

@trey-c
Copy link

trey-c commented Jun 9, 2020

Is their a safe/easy way to go about making logging/middle-ware routes?

P.S great library! We're about to use it in a production setting

@joncol
Copy link
Owner

joncol commented Jun 9, 2020

Hey! Glad you like it! I'm not sure I understand what you mean by "logging/middle-ware routes"? Could you explain it further and give some example?

@trey-c
Copy link
Author

trey-c commented Jun 17, 2020

Essentially I would like a more ideal way for logging routes. Because right now I'm just calling a logging function for every route I create, not a big deal but its a little tedious...

Perhaps something like this:
jcon::JsonRpcServer* rpc_server;
rpc_server = new jcon::JsonRpcWebSocketServer(parent);
rpc_server->registerLogger([](...) {
// this gets called before every route
});`
(Assuming something similar to this functionality doesn't already exist. lol)

And as for what I mean by middleware routes, something very similar to 'Node JS Express Middleware.' Not too sure how this could be implemented here. But it would be very neat.

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