# A native request handler

> Use the standard Worker request and response interfaces.

- Canonical page: https://docs.userland.fun/quickstarts/server-app/
- Docs index for agents: https://docs.userland.fun/llms.txt

> **For agents:** Read the [complete native guide](/native-guide.md) and current `context.get` capabilities. Use only implemented operations and preserve exact Account, app and environment authority.

A native app exports a standard Worker handler. Application state belongs in declared native bindings; credentials stay in server-side secret bindings.

```js
export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    if (url.pathname === '/health') return Response.json({ ok: true });
    return new Response('Not found', { status: 404 });
  }
};
```

Select the Account with `context.get`, apply source with `apps.apply`, and inspect `operations.get`. The platform validates the supported configuration, provisions declared resources and records failures. Do not equate an accepted request with a completed deployment.

Use advertised hosted command/browser capabilities to test the real behavior, fix failures and verify again. The [native guide](/native-guide.md) covers exact-source continuation, protected preview access and runtime diagnostics.
