-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document ENABLE_GATSBY_REFRESH_ENDPOINT #10328
Comments
<!-- Have any questions? Check out the contributing docs at https://gatsby.app/contribute, or ask in this Pull Request and a Gatsby maintainer will be happy to help :) --> ## Description I added a cURL example for the refresh endpoint e.g. http://localhost:8000/__refresh. ## Related Issues Related to #10328.
…10829) <!-- Have any questions? Check out the contributing docs at https://gatsby.app/contribute, or ask in this Pull Request and a Gatsby maintainer will be happy to help :) --> ## Description I added a cURL example for the refresh endpoint e.g. http://localhost:8000/__refresh. ## Related Issues Related to gatsbyjs#10328.
This ticket and https://github.com/gatsbyjs/gatsby/pull/10366/commits and https://github.com/gatsbyjs/gatsby/projects/2 are still the top Google hits. I have found https://www.gatsbyjs.org/docs/environment-variables/#reserved-environment-variables by reading the related commits. The helped me realize that the reason it seemed to not be working is that I need to POST to it rather than hit it with a browser. |
I understand how this refresh token is working and have tried it out on my local machine using localhost. However, I wonder how this can be implemented into a preview system for a non-developer, like a client that needs to preview content before publishing. Especially on Contentful, to set up the POST webhook, I need a non-localhost URL. I could use ngrok, but again, that only works in a limited scope, and wouldn't be a permanent and publicly-accessible URL for others to use. |
@drake-smith You can pass |
Hi @drake-smith i really need the same online preview for my gatsby contentfull website. thanks a lot ! |
Summary
Setting an env var
ENABLE_GATSBY_REFRESH_ENDPOINT=true
while runninggatsby develop
will configure the develop server to re-source data when it receives a POST request to/__refresh
.This is a really useful feature when working with content while developing your site. The only documentation for this at the moment lives in PR and issue comments. This information should live in the docs of gatsbyjs.org.
Basic example
Useful info available from:
Implementation:
gatsby/packages/gatsby/src/commands/develop.js
Lines 117 to 128 in 2f1b487
Possibly in other issues / PRs in this repo.
Motivation
This feature is too useful to remain undocumented 😄
The text was updated successfully, but these errors were encountered: