-
-
Notifications
You must be signed in to change notification settings - Fork 796
Closed
Description
What is the best way to use one service endpoints from others?
e.g. i write:
app.use('/d/*', find(url,req) { ... })
and then parse url to get what I want from query.
Then I use it more like
/d/sites/sitename.com/page1/?params
now i want to call it from another endpoint.
It feels strange to do
fetch("/d/sites/sitename.com/page1/?params")
So I try around with
#1 app.service('/d/sites/sitename.com/page1/?params')
#2 app.service('/d/*').find({route:{0:'/d/sites/sitename.com/page1/},query:{...params}}')
Option #1 doesnt find service
Option #2 works but looks ugly and requires me to choose function manually
Is there a way to do it properly?
Using nested endpoints logic I want to find a way to use it everywhere
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels