Functions
One HTTP endpoint or webhook, alone or next to another app.
On this page
A function is a single handler that answers HTTP requests. It can be an app on its own (a webhook receiver, a small API) or live inside another app’s deploy, under a path.
// functions/pay.ts — receives the payment provider's webhook
import { handler } from '@sypnia/run/function';
export default handler(async (req) => {
const event = await req.json();
// verify the signature, record the payment…
return Response.json({ ok: true });
});[run.apps.laespiga.functions.pay]
file = "functions/pay.ts"
path = "/api/pay"
memory = 512
timeout = 10What a function receives
A standard Request and returns a standard Response, the same objects as fetch. Environment variables and secrets are in process.env. The deploy id is in SYPNIA_DEPLOY_ID, and SYPNIA_APP/SYPNIA_ENV name the app and environment.
Languages
TypeScript and JavaScript are bundled by Run. Python, Go and Rust functions are supported through a Dockerfile (a Lambda container image) or a prebuilt zip with runtime set in the config.
Settings
| Field | Default | Range |
|---|---|---|
memory | 512 MB | 128 MB to 10 GB |
timeout | 10 s | 1 s to 900 s |
concurrency | none | a cap on simultaneous instances |
regions | the app’s region | one region (us-east-1) |