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

Issue having multiple routes in 1 plugin #191

Open
lukasrio opened this issue Apr 28, 2022 · 0 comments
Open

Issue having multiple routes in 1 plugin #191

lukasrio opened this issue Apr 28, 2022 · 0 comments

Comments

@lukasrio
Copy link

I have been trying to add more routes to the Router function into the router.Http{} of http.go file of plugins, in order to serve multiple endpoints from one plugin, such as:
func Router(s *service.Service) []router.Http {
svc = s
return []router.Http{
{"accounts", accounts},
{"account/address", accountdetails},
}
}

However this doesn't seem to work, the response for either endpoint is always that of the last function/endpoint (in this case func accountdetails. Response will be returned value of func accounts if I put that endpoint as the last one).

Is there any way to fix and enable the router to handle multiple endpoints?

Thanks
Lukas

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

1 participant