bfast-function

A lightweight serverless runtime for Node.js that loads function descriptors from files and exposes:

Package: bfast-function
Runtime: Node.js 18+

Two Ways to Use This Project

1) Function Author Guide

Use this when writing/organizing your functions.

Start here:

Minimal local example:

js
// index.mjs
import { start } from 'bfast-function';
import { dirname } from 'path';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));

await start({
  port: '3000',
  functionsConfig: {
    functionsDirPath: `${__dirname}/functions`,
    bfastJsonPath: `${__dirname}/bfast.json`
  }
});
bash
node index.mjs

2) Runtime Operator Guide

Use this when running the engine in Docker/swarm/CI and pulling function bundles remotely.

Start here:

Quick Checks

After startup:

bash
curl http://localhost:3000/functions-health
curl http://localhost:3000/functions-all

API Surface (Code References)

Development

bash
npm install
npm test

License

MIT

View source on GitHub ↗ · synced 2026-10-19 09:38 UTC