Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backend-fetch

A small helper that lets one FOMO service call another Lambda using a fetch-like API and an aws-lambda:// URL convention (e.g. aws-lambda://my-function/path?query=1). It parses the URL into an API Gateway-style event, invokes the target Lambda synchronously, and returns a response object with .text() and .json() helpers.

Stack

  • Node.js
  • @aws-sdk/client-lambda (Lambda InvokeCommand)

Setup

npm install

setDefaultOptions({ functionNameTransform }) can be used to map logical function names to deployed names (e.g. add a stage suffix). No environment variables are required; AWS credentials are taken from the standard SDK chain.

Usage

const { backendFetch, setDefaultOptions } = require("backend-fetch");
const res = await backendFetch("aws-lambda://auth/token", { method: "post", body: "..." });
const data = await res.json();

Deployment

Library — consumed by other services, not deployed standalone.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages