ente/infra/workers
Manav Rathi 12aa071adc
[meta] Add a special case for comments in the notifier workaround
Discord still hasn't fixed the issue on their end, and having a top level link
whenever a new comment is added is getting cumbersome, so add a handler for the
common comments case too.

Tested and deployed.
2024-03-28 10:11:04 +05:30
..
cast-albums [workers] Add the cast-albums worker 2024-03-19 15:33:09 +05:30
github-discord-notifier [meta] Add a special case for comments in the notifier workaround 2024-03-28 10:11:04 +05:30
.gitignore [workers] Start migrating workers to the monorepo 2024-03-19 13:14:25 +05:30
.prettierrc.json [workers] Start migrating workers to the monorepo 2024-03-19 13:14:25 +05:30
README.md wrangler publish is deprecated 2024-03-19 13:51:13 +05:30
tsconfig.base.json [workers] Start migrating workers to the monorepo 2024-03-19 13:14:25 +05:30

Cloudflare Workers

Source code for our Cloudflare Workers.

Each worker is a self contained directory with its each package.json.

Deploying

  • Switch to a worker directory, e.g. cd github-discord-notifier.

  • Install dependencies (if needed) with yarn

  • Login into wrangler (if needed) using yarn wrangler login

  • Deploy! yarn wrangler deploy

Wrangler is the CLI provided by Cloudflare to manage workers. Apart from deploying, it also allows us to stream logs from running workers by using yarn wrangler tail.

Creating a new worker

Copy paste an existing one. Unironically this is a good option because Cloudflare's template has a lot of unnecessary noise, but if really do want to create one from scratch, use npm create cloudflare@latest.

To import an existing worker from the Cloudflare dashboard, use

npm create cloudflare@2 existing-worker-name -- --type pre-existing --existing-script existing-worker-name