github-readme-quotes icon indicating copy to clipboard operation
github-readme-quotes copied to clipboard

Hosted Heroku link not working

Open bikkimahato opened this issue 3 years ago • 20 comments

Hosted Heroku link not working

Screenshots image

Desktop:

  • OS: [Windows]
  • Browser [chrome]

bikkimahato avatar Oct 27 '21 11:10 bikkimahato

have you uploaded database to server

abhijain2003 avatar Mar 03 '22 09:03 abhijain2003

getting the same error today...

tanmayyb avatar May 27 '22 03:05 tanmayyb

heroku logs --tail --app your_app_name run this command in git and check do you get any errors in deploy if yes then deploy it again with a correct manner

abhijain2003 avatar May 27 '22 03:05 abhijain2003

hey abhi, I'm using the api for this repository in one of my readme.md's. how would I go about doing what you just told me in my case? Thanks in advance.

tanmayyb avatar May 27 '22 04:05 tanmayyb

that does not matter in you git cd to the root folder of your project and run the command to check logs of Heroku. if you find out error in logs. if you use any string in API which store in .env file then you need to add environment variables in heroku app also

abhijain2003 avatar May 27 '22 04:05 abhijain2003

the api used to work in my private repository README's before, but this week due to some reason it suddenly stopped working. I don't think I have heroku installed on my end so this is what I get when I try to run heroku logs --tail --cam_sys-22 (my repo is named cam_sys-22). image

This is what it looks like in my repos: Inside Readme.md: image When clicking on it: image

I used this to invoke the api:

<p align="center"> 
  <img src="https://github-readme-quotes.herokuapp.com/quote?quotesUrl=https://github.com/teamr3/public-quotes/blob/master/auton_sys-22/quote-1.json">
</p>

Hope this helps, thanks!

tanmayyb avatar May 27 '22 22:05 tanmayyb

go to youtube and watch a tutorial for this try deployment again from start

abhijain2003 avatar May 28 '22 02:05 abhijain2003

Since we are using a free quota, every month we have a downtime of 1/1.5 day for which it won't be available. I hope that clarifies system unavailability of the utility for some time every month

shravan20 avatar Jul 11 '22 04:07 shravan20

Got it! Thanks @shravan20, makes sense!

tanmayyb avatar Jul 11 '22 13:07 tanmayyb

why not host it on some other provider then which is free? like netlify maybe @shravan20

mananbansal2002 avatar Aug 18 '22 13:08 mananbansal2002

Can anyone pick this up for deployment in any of the service of your own?

shravan20 avatar Jul 09 '23 21:07 shravan20

Why not shift the code to render.com?

ashishk1331 avatar Sep 26 '23 17:09 ashishk1331

Why not shift the code to render.com?

This has been moved to GCP now, you can continue using it.

shravan20 avatar Sep 26 '23 18:09 shravan20

That's the reason why your IP for the URL for the project. However, the site doesn't works on handheld devices.

Also, from the website to README file, the forwarding URL is mentioned of heroku. I think that needs a change.

SmartSelect_20230927-185135_GitHub.jpg

ashishk1331 avatar Sep 27 '23 13:09 ashishk1331

@ashishk1331 : I am able to access the website in mobile devices. Do you want to pick this issue up to update the documents with images instead of those URL so as to save unwanted API additional calls? Or we can make it cacheable calls too, I think this is a better idea. Would you like to pick this up?

shravan20 avatar Sep 27 '23 13:09 shravan20

Yes sir. I would love to pick it up.

Also, I'm a bit confused about replacing API calls with images. So, Instead of displaying API endpoint you want to display pre-saved images for the same?

I can update the API url to match the current url in different documents.

ashishk1331 avatar Sep 27 '23 13:09 ashishk1331

@ashishk1331:

This part of the code is responsible for not caching the response in the github content and dynamically generating new quotes that is shown on the github readme. This part of the code explicitly set response header to expire the reponse within 0 seconds even if it has been cached, forcing it to invalidated.

You can introduce a field to skip this caching and completely skip the below header being set. This would ensure github cache not being invalidated.

     res.header(
        "Cache-Control",
        "no-cache,max-age=0,no-store,s-maxage=0,proxy-revalidate"
        );
     res.header("Pragma", "no-cache");
     res.header("Expires", "-1");

Please find this code in src/api/controllers/quotesController.js

shravan20 avatar Sep 27 '23 14:09 shravan20

I implemented public caching for 1 hour. The time limit can be changed by modifying the hours variable before the header. However, I think until and unless there is a change made by the user, we can cache the response for a year. Because README remains still for years. image

ashishk1331 avatar Sep 27 '23 19:09 ashishk1331

Let's keep it optional, only if you pass a value in query params, since we want to maintain the basic USP of the product to generate Dynamic Quote

shravan20 avatar Sep 27 '23 19:09 shravan20

Okay. So the query parameters namely cache and expire_after can do the trick,

cache = true | false
expire_after = 1 (hours)

Would generate the cache header with max age of 1 hour. Something like this?

ashishk1331 avatar Sep 27 '23 19:09 ashishk1331

Folks we have moved it to vercel, closing this issue. Please do check the latest documentation changes.

shravan20 avatar Mar 21 '24 05:03 shravan20

Marking this as closed as it is fixed, by migrating the application to vercel

shravan20 avatar Mar 21 '24 05:03 shravan20