The dev command should use a POST request when doing the PING to the local server

This commit is contained in:
Eric Allam
2023-08-03 13:01:08 +01:00
parent feaa79ecf3
commit 81180999de
3 changed files with 13 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/express": patch
"@trigger.dev/cli": patch
---
The dev command should use a POST request when doing the PING to the local server
+1 -1
View File
@@ -71,7 +71,7 @@ export async function devCommand(path: string, anyOptions: any) {
try {
await fetch(localEndpointHandlerUrl, {
method: "HEAD",
method: "POST",
headers: {
"x-trigger-api-key": apiKey,
"x-trigger-action": "PING",
+6
View File
@@ -60,6 +60,12 @@ export function createMiddleware(client: TriggerClient, path: string = "/api/tri
return;
}
if (req.method === "HEAD") {
res.sendStatus(200);
return;
}
const request = convertToStandardRequest(req);
const response = await client.handleRequest(request);