Aller au contenu
#0294
ExecSqlite

The analyst ships the metrics API without a ticket

Product wants weekly active accounts on the admin page. You have the query. What you don't have is a backend engineer with a free sprint.

You write api/metrics/wau.ts in your exec scripts folder. Three lines of magic comments at the top: @mode worker, @token with a shared secret, @cors https://admin.yourco.com. The body fetch()es your hoody-sqlite URL, runs the SELECT, reshapes the rows, returns JSON.

The file existing is the deployment. Product's frontend calls /api/metrics/wau with the token; the number is on the admin page by lunch. When they want it by plan, you edit the query and save.

No Express, no Lambda packaging, no API gateway route, no infra review. The analyst owns the endpoint because the endpoint is a file next to the SQL.

The ticket to backend was never about the query. It was about the hosting.