Skip to content

Using with express to mock a function URL #12

@HeskethGD

Description

@HeskethGD

Is it possible to use this package together with express to mock a locally running Lambda function url that I can ping from a locally running frontend? I wanted to do something like the below but cannot seem to figure out how to marry the response object in express to the responseStream in the handler which is wrapped with streamifyResponse:

app.get("/", async (req: Request, res: Response) => {
    // Do something here to transform req to event...
    // Do something to connect res and responseStream somehow?...
    await handler(
        event: APIGatewayProxyEventV2,
        responseStream: ResponseStream,
        null
    );
})

I have read in a few places that the response object in express is a stream but can't seem to make this work.

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