How to use the @laconia/event.req function in @laconia/event

To help you get started, we’ve selected a few @laconia/event examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laconiajs / laconia / packages / laconia-acceptance-test / src / accept-order.js View on Github external
withCors(async (event, dependencies) => {
    try {
      const id = req(event).params.id;
      const output = await app(id, dependencies);
      return res(output);
    } catch (err) {
      return res(err.message, 500);
    }
  });
github laconiajs / laconia / packages / laconia-adapter-api / src / ApiGatewayParamsInputConverter.js View on Github external
convert(event) {
    const apiGatewayEvent = req(event);
    return {
      payload: Object.assign(
        { body: apiGatewayEvent.body },
        apiGatewayEvent.params
      ),
      headers: apiGatewayEvent.headers
    };
  }
};
github laconiajs / laconia / packages / laconia-adapter-api / src / ApiGatewayBodyInputConverter.js View on Github external
convert(event) {
    const apiGatewayEvent = req(event);
    return {
      payload: apiGatewayEvent.body,
      headers: Object.assign(
        {},
        apiGatewayEvent.headers,
        apiGatewayEvent.params
      )
    };
  }
};