Hi ,

The following app.yaml file should work with Gatsby using the handlers like 

handlers:

  - url: /
    static_files: public/index.html
    upload: public/index.html

  - url: /((.*\/)*[^\/]+\.[^\/]+)$
    static_files: public/\1
    upload: public/.*

  - url: /(.*)$
    static_files: public/\1/index.html
    upload: public/.*/index.html

I also found this article[1] which might be helpful for your scenario. You 
can also check our documentation[2] for app.yaml elements which might be a 
great way to start resolving the error.

If you still have issues, I would suggest to please do open a case with us 
using [3] with all the information and we will look into it deeply.

Thanks,

Sivaranjani,
Google Cloud Platform Support, Montreal

[1]https://stackoverflow.com/questions/54616748/proper-app-yaml-handlers-configuration-for-google-app-engine-for-a-static-html-w
[2]https://cloud.google.com/appengine/docs/standard/python/config/appref
[3]https://cloud.google.com/support/docs/manage-cases#creating_cases











On Monday, March 21, 2022 at 5:33:06 AM UTC-4 
[email protected] wrote:

> FYI,
> I explored gatsby-express-plugin 
> It does not have the above two issues.
>
> Please see  bgsample.appspot.com/gatsby-express 
> <https://mailtrack.io/trace/link/c0ac2a87817871112941e508cb9754c99391f292?url=http%3A%2F%2Fbgsample.appspot.com%2Fgatsby-express&userId=6615365&signature=f38da828cceb6a5c>
>
> See the corresponding github repository:  
> https://github.com/rajesh99/bgsample 
> <https://mailtrack.io/trace/link/76108dc11b37289282efdd21d50f15c796ed7095?url=https%3A%2F%2Fgithub.com%2Frajesh99%2Fbgsample&userId=6615365&signature=2adf894c1636b3e6>
>
> Rajesh
> www.servicefolder.com 
> <https://mailtrack.io/trace/link/7e5b2560c97b7ebaa952651c7b01b7ee2802e8e9?url=https%3A%2F%2Fwww.servicefolder.com%2F&userId=6615365&signature=8c1bb57dc7e01022>
> *Field Service Software on Google Cloud Platform and Mobile*
>
>
>
>
> On Thu, Mar 17, 2022 at 6:48 PM Rajesh G <[email protected]> 
> wrote:
>
>> I am further continuing to explore deploying a gatsby project to appengine
>>
>> I created an appengine service called 'gatsby', and I want to serve in 
>> the following manner
>> https://bgsample.appspot.com/gatsby 
>> <https://mailtrack.io/trace/link/dd7d91af6834badffa0a8a87feef4f219ec51f45?notrack=1&url=https%3A%2F%2Fbgsample.appspot.com%2Fgatsby&userId=6615365&signature=6fa16981fc83af6d>
>>
>> app.yaml: gatsby-standard folder in the github: 
>> https://github.com/rajesh99/bgsample 
>> <https://mailtrack.io/trace/link/650a3ecacb84ef69c43564883351e3fbb28cc7e3?notrack=1&url=https%3A%2F%2Fgithub.com%2Frajesh99%2Fbgsample&userId=6615365&signature=1a0ecb1bf559761c>
>>
>> runtime: nodejs14
>> service: gatsby
>>
>> handlers:
>> - url: /gatbsy
>>   static_files: public/index.html
>>   upload: public/index.html
>> - url: /gatsby/
>>   static_files: public/index.html
>>   upload: public/index.html
>> - url: /gatsby/(.*)
>>   static_files: public/\1
>>   upload: public/(.*)
>>
>>
>> The main project: default-standard folder in the github: 
>> https://github.com/rajesh99/bgsample 
>> <https://mailtrack.io/trace/link/db34686008f2059e9bf200d9814baad8d0f4e9be?notrack=1&url=https%3A%2F%2Fgithub.com%2Frajesh99%2Fbgsample&userId=6615365&signature=5c6657298e9d2d08>
>> dispatch.yaml
>> dispatch:
>>   # Send all listing traffic to the listing frontend.
>> - url: "*/prolisting/*"
>>   service: prolisting
>> - url: "*/prolisting"
>>   service: prolisting
>> - url: "*/gatsby/*"
>>   service: gatsby
>> - url: "*/gatsby"
>>   service: gatsby
>>
>>
>> There are two issues
>> 1st issue:
>> https://bgsample.appspot.com/gatsby/ 
>> <https://mailtrack.io/trace/link/a5b487a3222dc922310a638070a6bcd3fbe46544?notrack=1&url=https%3A%2F%2Fbgsample.appspot.com%2Fgatsby%2F&userId=6615365&signature=d094100e3a221c29>
>>   
>> - this works
>> https://bgsample.appspot.com/gatsby 
>> <https://mailtrack.io/trace/link/10b47b7b1f02681de60c44dfa6b530f627309f71?notrack=1&url=https%3A%2F%2Fbgsample.appspot.com%2Fgatsby&userId=6615365&signature=42853a4619eb155d>
>>  
>> - this does not work - why?
>>
>> 2nd issue:
>> https://bgsample.appspot.com/gatsby/ 
>> <https://mailtrack.io/trace/link/ab9e3a2703e454f69635dd391c9b22d857aa32d8?notrack=1&url=https%3A%2F%2Fbgsample.appspot.com%2Fgatsby%2F&userId=6615365&signature=4e4ecd4330f21bf2>
>>  
>> - Then click on 'A' link it works.
>> Now you do refresh, it does not work.  Following displays on the browser
>> "Error: Not Found
>> The requested URL /gatsby/a/ was not found on this server."
>>
>> I used the following reference to serve gatsby static files
>> https://github.com/gatsbyjs/gatsby/issues/22711 
>> <https://mailtrack.io/trace/link/0040ef4ffef364b6673507745166048c64fbd417?notrack=1&url=https%3A%2F%2Fgithub.com%2Fgatsbyjs%2Fgatsby%2Fissues%2F22711&userId=6615365&signature=10685a1f073ebb26>
>>
>> I have to say, I did not understand some parts of the app.yaml file.
>>
>> Appreciate any help.
>>
>> Cheers.
>>
>> [image: image.gif]
>>
> On Tue, Mar 15, 2022 at 4:11 PM Rajesh G <[email protected]> 
>> wrote:
>>
> Ok.  It works now.  Thanks
>>>
>>> [image: image.gif]
>>>
>> On Mon, Mar 14, 2022 at 9:35 PM 'Jofre Riba Sánchez' via Google App 
>>> Engine <[email protected]> wrote:
>>>
>> 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 
>>>> <https://mailtrack.io/trace/link/0f695233784b84e219b95223e85713ab1382ebba?url=https%3A%2F%2Fexpressjs.com%2Fen%2Fguide%2Frouting.html&userId=6615365&signature=47a3d2c166c0c0cc>
>>>>
>>> On Saturday, March 12, 2022 at 7:43:46 AM UTC+1 
>>>> [email protected] 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 
>>>>> <https://mailtrack.io/trace/link/d7baac35a6d18d01f6a2bee366c66c74cff13f67?url=http%3A%2F%2Fbgsample.appspot.com&userId=6615365&signature=46aaae6527a7d293>
>>>>> .
>>>>> The default works: bgsample.appspot.com 
>>>>> <https://mailtrack.io/trace/link/422508dcca371d7535c9c9fb29bac5249061967d?url=http%3A%2F%2Fbgsample.appspot.com&userId=6615365&signature=55c62dc5dbf07cca>
>>>>> The prolisting also works: 
>>>>> https://prolisting-dot-bgsample.uc.r.appspot.com 
>>>>> <https://mailtrack.io/trace/link/f83b2aff82c5c54c75363c0f59d52c1de33ccc95?url=https%3A%2F%2Fprolisting-dot-bgsample.uc.r.appspot.com&userId=6615365&signature=56ef03fd6106d0e2>
>>>>>
>>>>> However, the following URL does not work
>>>>> https://bgsample.appspot.com/prolisting 
>>>>> <https://mailtrack.io/trace/link/8b9b23aca6ae6d432d399cdd97d3c5e15fa157e6?url=https%3A%2F%2Fbgsample.appspot.com%2Fprolisting&userId=6615365&signature=f7e8f07448485c69>
>>>>>  
>>>>>
>>>>> 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/7e49c34a99bbb00adab6b136a625551c0bd5fd94?url=https%3A%2F%2Fgithub.com%2Frajesh99%2Fbgsample&userId=6615365&signature=eebee81a81c74eb7>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> --
>>>>> Support Team
>>>>> www.servicefolder.com 
>>>>> <https://mailtrack.io/trace/link/9f3182f7f2e8bdf00445010f343d19abed9d65ac?url=https%3A%2F%2Fwww.servicefolder.com&userId=6615365&signature=7a7e02b135f363fb>
>>>>> *Field Service Software on Google Cloud Platform and Mobile*
>>>>>
>>>>>
>>>>> [image: image.gif]
>>>>>
>>>> -- 
>>>> 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 [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/google-appengine/d77d5b82-4bcb-43ac-821f-91454007a310n%40googlegroups.com
>>>>  
>>>> <https://mailtrack.io/trace/link/9e00d92bd768638ee71e1f8e43a3184d191b4899?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fgoogle-appengine%2Fd77d5b82-4bcb-43ac-821f-91454007a310n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&userId=6615365&signature=9888e20cc394030f>
>>>> .
>>>>
>>>
>>>
>>> -- 
>>> Support Team
>>> www.servicefolder.com 
>>> <https://mailtrack.io/trace/link/b4b26b6a0f4896e1ab65e5ba7a7a9ef04e23e52b?url=https%3A%2F%2Fwww.servicefolder.com&userId=6615365&signature=994e1e60859978b0>
>>> *Field Service Software on Google Cloud Platform and Mobile*
>>>
>>>
>>>
>>
>> -- 
>> Support Team
>> www.servicefolder.com 
>> <https://mailtrack.io/trace/link/c0438748bd852a4c4f8f2095c1781331a3072509?url=https%3A%2F%2Fwww.servicefolder.com&userId=6615365&signature=c2a8ff0d8ac24d8a>
>> *Field Service Software on Google Cloud Platform and Mobile*
>>
>>
>>
> -- 
> Support Team
> www.servicefolder.com 
> <https://mailtrack.io/trace/link/bfce8ef37d107e346a8765e5cc39a4b3efe40a48?url=https%3A%2F%2Fwww.servicefolder.com&userId=6615365&signature=fe1f91179d7b5a30>
> *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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/ada29da5-0285-4efc-95b7-99bfb10f54f1n%40googlegroups.com.

Reply via email to