Skip to content

Commit

Permalink
update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Dec 4, 2020
1 parent c0a5fb3 commit 3a2f286
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions e2e-tests/development-runtime/scripts/cms-webhook.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
require(`isomorphic-fetch`)

console.log(`
console.log(
`
firing this thing up!
`, process.argv)
`,
process.argv
)

fetch(`http://localhost:8000/__refresh/${process.argv[2]}`, {
method: `POST`,
headers: {
"Content-Type": `application/json`,
},
body: JSON.stringify({
"fake-data-update": true,
}),
})
2 changes: 1 addition & 1 deletion packages/gatsby/src/utils/start-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export async function startServer(
})
}

app.use(REFRESH_ENDPOINT, express.json())
app.post(`${REFRESH_ENDPOINT}/:plugin_name`, (req, res) => {
console.log(`
Expand All @@ -222,7 +223,6 @@ export async function startServer(
res.end()
})

app.use(REFRESH_ENDPOINT, express.json())
app.post(REFRESH_ENDPOINT, (req, res) => {
const enableRefresh = process.env.ENABLE_GATSBY_REFRESH_ENDPOINT
const refreshToken = process.env.GATSBY_REFRESH_TOKEN
Expand Down

0 comments on commit 3a2f286

Please sign in to comment.