Functions
هذا المحتوى غير متوفر بلغتك بعد.
Feature: Functions
Section titled “Feature: Functions”ɳSelf includes a serverless runtime for running custom backend logic close to your data.
What’s Included
Section titled “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
Section titled “How to Enable”nself service enable functionsnself build && nself restartOr set in .env:
FUNCTIONS_ENABLED=trueKey Configuration Variables
Section titled “Key Configuration Variables”| Variable | Description | Default |
|---|---|---|
FUNCTIONS_ENABLED | Enable Functions service | false |
FUNCTIONS_PORT | Internal port | 3000 |
Deploying Functions
Section titled “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.tsFunctions are available at: https://functions.your-domain.com/v1/{function-name}
Event Triggers
Section titled “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
Section titled “See Also”- cmd-service: enable/disable functions
- Config-Env-Vars: full env var reference
- Architecture: how functions integrate with the stack