Your app.js in the prolisting folder of the example repo does not have a 
handler for the /prolisting path. This is why express can't get the 
/prolisting [1].

Fix this by adding an additional handler for the path in app.js:

app.get('/prolisting', (req, res) => {
res.status(200).send('Hello, world prolisting!').end();
});

Note that when you dispatch with a path (i.e. /prolisting), the path is 
kept when calling the dispatched service. The dispatch rules do not remove 
the path. 

[1] https://expressjs.com/en/guide/routing.html
On Saturday, March 12, 2022 at 7:43:46 AM UTC+1 
rajesh...@veersoftsolutions.com wrote:

> Hi,
> I created two simple services based on nodejs and hello-world sample.
>
> I am trying to explore dispatch.yaml
> My dispatch.yaml.
> dispatch:
>   # Send all listing traffic to the listing frontend.
> - url: "*/prolisting/*"
>   service: prolisting
> - url: "*/prolisting"
>   service: prolisting
> - url: "*/*"
>   service: default
>
>
> 'prolisting' service app.yaml
> runtime: nodejs14
> service: prolisting
>
> default service app.yaml
> runtime: nodejs14
>
> I have uploaded to bgsample.appspot.com.
> The default works: bgsample.appspot.com
> The prolisting also works: 
> https://prolisting-dot-bgsample.uc.r.appspot.com 
> <https://mailtrack.io/trace/link/e5103b0265258323880273f5e2cadc79586c41ba?url=https%3A%2F%2Fprolisting-dot-bgsample.uc.r.appspot.com&userId=6615365&signature=7a0fb26aecdfc16f>
>
> However, the following URL does not work
> https://bgsample.appspot.com/prolisting 
> <https://mailtrack.io/trace/link/f4a47c698c04aeb464144504a2a18bea2cc6d40e?url=https%3A%2F%2Fbgsample.appspot.com%2Fprolisting&userId=6615365&signature=ade8a4bdd9c5c81f>
>  
>
> As per the dispatch.yaml, it should route to prolisting service, but gives 
> the following error
> Cannot GET /prolisting
>
> my repo: 
> https://github.com/rajesh99/bgsample 
> <https://mailtrack.io/trace/link/0b8754f3af05b6e4c240d283636195c3a9b3e80a?url=https%3A%2F%2Fgithub.com%2Frajesh99%2Fbgsample&userId=6615365&signature=468bb3c4bd31465f>
>
> Cheers,
>
> --
> Support Team
> www.servicefolder.com 
> <https://mailtrack.io/trace/link/a47972fd249cca18d951f85ad7b7968e939820fc?url=https%3A%2F%2Fwww.servicefolder.com&userId=6615365&signature=49aff18e5ac0380c>
> *Field Service Software on Google Cloud Platform and Mobile*
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d77d5b82-4bcb-43ac-821f-91454007a310n%40googlegroups.com.

Reply via email to