Skip to content

Functions

One HTTP endpoint or webhook, alone or next to another app.

Applies to EngineCloud
View as Markdown
On this page
  1. What a function receives
  2. Languages
  3. Settings

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.

TypeScript
// 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 });
});
sypnia.toml
[run.apps.laespiga.functions.pay]
file = "functions/pay.ts"
path = "/api/pay"
memory = 512
timeout = 10

What 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

FieldDefaultRange
memory512 MB128 MB to 10 GB
timeout10 s1 s to 900 s
concurrencynonea cap on simultaneous instances
regionsthe app’s regionone region (us-east-1)
  1. What a function receives
  2. Languages
  3. Settings

    Search pages, sections and terms