bfast-function
v3.2.4
Published
A serverless function engine for Node.js, built on top of Express.js and Socket.IO.
Maintainers
Readme
bfast-function
A lightweight serverless runtime for Node.js that loads function descriptors from files and exposes:
- HTTP routes (Express)
- Socket.IO events
- middleware guards
- scheduled jobs
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:
// 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`
}
});node index.mjs2) Runtime Operator Guide
Use this when running the engine in Docker/swarm/CI and pulling function bundles remotely.
Start here:
Quick Checks
After startup:
curl http://localhost:3000/functions-health
curl http://localhost:3000/functions-allAPI Surface (Code References)
start/stopentry points:src/core.mjs- env-driven starter:
src/start.mjs - descriptor loading rules:
src/controllers/resolver.mjs - route/event/job mounting:
src/controllers/index.mjs - option model docs:
src/models/options.mjs
Development
npm install
npm testLicense
MIT
