Skip to content

fahamutech/bfast-functions

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.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:

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

API Surface (Code References)

  • start/stop entry 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 test

License

MIT

About

Cloud function node run-time for BFast::Cloud platform

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages