Feature Functions - nself-org/cli GitHub Wiki

Feature: Functions

ษณSelf includes a serverless runtime for running custom backend logic close to your data.

What's Included

Capability Description
HTTP triggers Run functions on HTTP requests
Event triggers Respond to Hasura database events
Cron triggers Schedule functions on a cron expression
TypeScript/JavaScript Node.js runtime

How to Enable

nself service enable functions
nself build && nself restart

Or set in .env:

FUNCTIONS_ENABLED=true

Key Configuration Variables

Variable Description Default
FUNCTIONS_ENABLED Enable Functions service false
FUNCTIONS_PORT Internal port 3000

Deploying Functions

Place function files in your project's functions/ directory. ษณSelf mounts this directory into the Functions container automatically.

my-project/
โ””โ”€โ”€ functions/
    โ”œโ”€โ”€ hello-world.ts
    โ””โ”€โ”€ send-email.ts

Functions are available at: https://functions.your-domain.com/v1/{function-name}

Event Triggers

Configure event triggers in the Hasura console or via Hasura migrations to call functions when database rows are inserted, updated, or deleted.

See Also


โ† [Home]] ](/nself-org/cli/wiki/[[_Sidebar)