From 63ac3ad713ddb651d3efc9202c5c98128c4093c5 Mon Sep 17 00:00:00 2001 From: Mayank Jain Date: Wed, 8 May 2024 18:06:01 +0530 Subject: [PATCH] Express workflow fix: Add Content Type to curl call (#4885) * added content type header to example commands on index.ts * removed console logging --- examples/express-workflow/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/express-workflow/index.ts b/examples/express-workflow/index.ts index 7a9927cfe1..630a21bc8f 100644 --- a/examples/express-workflow/index.ts +++ b/examples/express-workflow/index.ts @@ -47,7 +47,6 @@ app.post('/workflows/:workflowId', (req, res) => { const actor = createActor(machine, { snapshot: snapshot as AnyMachineSnapshot }).start(); - actor.send(event); // @ts-ignore @@ -81,7 +80,7 @@ app.get('/', (_, res) => {

Start a new workflow instance:

curl -X POST http://localhost:4242/workflows

Send an event to a workflow instance:

-
curl -X POST http://localhost:4242/workflows/:workflowId -d '{"type":"TIMER"}'
+
curl -X POST http://localhost:4242/workflows/:workflowId -d '{"type":"TIMER"}' -H "Content-Type: application/json" 

Get the current state of a workflow instance:

curl -X GET http://localhost:4242/workflows/:workflowId