crouter
Plugin

Getting started

Install the plugin package, deploy a Fetch handler, and install its commands in crtr.

Getting started

Install @north-light/crouter-plugin, copy the complete TypeScript file in the package README, and deploy its default export at the URL crtr will reach. The application must provide ACME_CRTR_TOKEN to its handler and the machine running crtr must provide the same value.

npm install @north-light/crouter-plugin
export ACME_CRTR_TOKEN='replace-with-a-secret'
crtr pkg plugin install --endpoint https://acme.example.com/crtr --name acme --auth-env ACME_CRTR_TOKEN
crtr acme app create my-app --region eu-west

export covers commands you type yourself. An agent's crtr acme … runs inside its broker, whose env comes from the profile env store, not from your shell — so for agents, store the token there too: echo -n "$ACME_CRTR_TOKEN" | crtr profile env set <profile> --name ACME_CRTR_TOKEN. Nodes launched under that profile from then on carry it.

The endpoint receives GET to provide the install archive and POST to run a command. A successful non-streaming command response is the bare JSON object returned by the handler, for example { "appId": "app_my-app", "url": "https://my-app.eu-west.acme.example.com" }. It is not an exec-style protocol envelope.

Run crtr pkg plugin show acme after installation to inspect the installed command tree, and crtr sys doctor to check the installed package. A plugin name collision with crtr or another installed plugin is determined during installation and cannot be predicted from an application repository alone.

Continue with deployment before mounting the handler below the origin root or behind a proxy.