Skip to content
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

Add endpoint for refresh #3293

Merged
merged 1 commit into from
Dec 20, 2017
Merged

Conversation

jtschulz
Copy link
Contributor

This is only active if you actively enable via an environment variable. This is following up on #3054 per @KyleAMathews 's idea for a #dark-deploy

This is only active if you actively enable via an environment variable.
@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 28da65b

https://deploy-preview-3293--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

Like the hashtag :-) #darkdeploy

Thanks!

@Jrousell
Copy link

Jrousell commented Mar 14, 2018

Hi, this is exactly what I've been looking for - the ability to force a refresh of the fetched content, whilst in gatsby develop. Is there a doc, example or anything on how to set this up, which env vars to set etc... Many thanks

@Jrousell
Copy link

Got it working and it's awesome - many thanks.

@tlvenn
Copy link

tlvenn commented Mar 22, 2018

@Jrousell any chance you could document how you got this working ? Thanks in advance !

@nik-s
Copy link

nik-s commented Mar 22, 2018

@tlvenn you need to enable the ENABLE_GATSBY_REFRESH_ENDPOINT env variable when you start the development server, for example:

export ENABLE_GATSBY_REFRESH_ENDPOINT=true && gatsby develop

Then you make a POST request to the __refresh endpoint in order to refresh data:

curl -X POST http://localhost:8000/__refresh

@ThiagoMiranda
Copy link

@nik-s is there any indication that:
1- I´m deploying in ENABLE_GATSBY_REFRESH_ENDPOINT mode true
2- The POST was succesfull? I´m not getting any response from the server

@richhiggins
Copy link
Contributor

I've been trying this - using ngrok locally, finding it to be unreliable so far. sometimes the update is fine, sometimes I end up with errors usually something along the lines of TypeError: Cannot read property 'name' of undefined. restarting dev resolves this, sometimes removing the reference from the JSX, saving, and then putting back also resolves this. anyone had similar experience?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants