Quickstarts

Server App

Publish a dynamic app with a Userland server entrypoint.

For agents: Add runtime.server_entry, set fallback to server, and export a default server module with fetch(request, ctx).

Files

manifest.userland.json
public/index.html
server/index.js

Server

export default {
  async fetch(request, ctx) {
    const url = new URL(request.url);
    if (url.pathname === "/api/health") {
      return Response.json({ ok: true, app_id: ctx.app.app_id });
    }
    return new Response("not found", { status: 404 });
  }
};