Skip to content

Question on internal routing #1056

Description

@nickerlan

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions