Resources
Functions
Serverless function management
Deploy and manage serverless functions.
Endpoints
List Functions
GET /:namespace/functionsGet Function
GET /:namespace/functions/:idDeploy Function
POST /:namespace/functionsBody:
{
"name": "process-order",
"code": "export default async (req) => { ... }",
"runtime": "node",
"memory": 256
}Update Function
PUT /:namespace/functions/:idDelete Function
DELETE /:namespace/functions/:idInvoke Function
POST /:namespace/functions/:id/invokeBody:
{
"orderId": "order_123",
"items": [...]
}SDK
import { $ } from 'sdk.do'
const client = $('acme.com')
// Deploy
const fn = await client.Function.create({
name: 'process-order',
code: 'export default async (req) => { ... }',
runtime: 'node',
memory: 256
})
// Invoke
const result = await client.Function.invoke('fn_123', {
orderId: 'order_123',
items: [...]
})
// List
const functions = await client.Function.list()
// Delete
await client.Function.delete('fn_123')