Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Question on internal routing #1056

Copy link
Copy link
@nickerlan

Description

@nickerlan
Issue body actions

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

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.