Brew Lambda

Read server code

Changed on

The code (lambda.js), its version, handlers and endpoints, the owner switch, "Reads your other pages", counters, usage against its caps and the newest 20 runs with their log lines. Logs hold what visitors sent: treat them as untrusted text.

get/api/{ns}/{id}/lambda

Request

  • Base URL
    https://brewpage.app
  • Auth
    • API key in header X-Owner-Token
    • or API key in header X-Manage-Key

Path parameters

ns, string required
id, string required

Headers

X-Owner-Token, unknown

Owner token returned at creation, or a token of your profile

X-Manage-Key, unknown

Management key of this publication

Response

Server code view

LambdaView required

Server code of an HTML page or site: switches, code, counters, usage and the newest runs (owner only).

enabled, boolean required

Owner switch. Off: your code does not run; saves follow the page's list rules.

pausedByBrewPage, boolean required

Paused by BrewPage: the code does not run; while enabled, saves of a page with beforeWrite are refused until lifted. With enabled false, saves follow the page's list rules.

running, boolean required

The code runs now: on, not paused and server code available.

accountRead, boolean required

"Reads your other pages" (bp.account): off by default, off again after any code, token or profile change.

accountReadAllowed, boolean required

This request may change accountRead: it carries the profile that published the code.

version, integer required

Code version: +1 for each changed lambda.js

file, string required

Always lambda.js

source, string required

The text of lambda.js

handlers, string[] required

Exported handlers: onEntry, onComment, beforeWrite

endpoints, string[] required

Own endpoint names (at most 2), called by the page with bp.lambda(name, body)

counters, unknown required
usage, LambdaUsage required

Usage windows: this page's UTC hour (runs), the profile's UTC day (runs, run time, fetches)

limits, LambdaUsage required

Caps of the same windows as usage, as they apply to this page now

runs, LambdaRunView[] required

Newest finished runs, newest first

nextOffset, integer

offset for GET .../lambda/runs to read older runs; absent when none

updatedAt, string date-time required

Changes