Skip to content

starting a server and requesting it in the same block does not work #121

@markmeeus

Description

@markmeeus

-- Set up a webhook receiver
server = sandman.server.start(7010)

webhook_data = nil
sandman.server.post(server, "/webhook", function(request)
webhook_data = sandman.json.decode(request.body)
print("Received webhook:", webhook_data)
return {body = "ok"}
end)

-- In another block, trigger the webhook
response = sandman.http.post("http://localhost:7010/webhook",
{["Content-Type"] = "application/json"},
sandman.json.encode({event = "test", timestamp = os.time()})
)

-- Verify the webhook was received
print("Webhook data:", webhook_data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions