{"id":19571655,"url":"https://github.com/serlo/cloudflare-worker","last_synced_at":"2025-04-27T03:32:31.850Z","repository":{"id":37868874,"uuid":"235893487","full_name":"serlo/cloudflare-worker","owner":"serlo","description":"Cloudflare worker which works as a proxy for https://serlo.org/","archived":false,"fork":false,"pushed_at":"2025-04-22T07:36:11.000Z","size":8597,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"staging","last_synced_at":"2025-04-22T08:32:04.965Z","etag":null,"topics":["cloudflare","cloudflare-worker","serlo","service","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serlo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-23T21:49:04.000Z","updated_at":"2025-04-22T07:36:13.000Z","dependencies_parsed_at":"2025-01-28T11:29:07.695Z","dependency_job_id":"dd24d445-376a-4d13-8b66-1fb8de96a300","html_url":"https://github.com/serlo/cloudflare-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serlo%2Fcloudflare-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serlo%2Fcloudflare-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serlo%2Fcloudflare-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serlo%2Fcloudflare-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serlo","download_url":"https://codeload.github.com/serlo/cloudflare-worker/tar.gz/refs/heads/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251085145,"owners_count":21533821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","cloudflare-worker","serlo","service","typescript"],"created_at":"2024-11-11T06:19:41.352Z","updated_at":"2025-04-27T03:32:31.844Z","avatar_url":"https://github.com/serlo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/serlo/frontend/staging/apps/web/public/_assets/img/serlo-logo-gh.svg\" alt=\"Serlo Logo\" title=\"Serlo\" align=\"right\" height=\"75\" /\u003e\n\n# serlo.org – Cloudflare Worker\n\nThis repository contains the source code for the cloudflare worker of [Serlo](https://serlo.org/).\n\n## Development\n\n### Helpful commands\n\n- `yarn test` – run all tests\n- `yarn lint` – run linter against the codebase\n- `yarn check:all` – run all checks (tests and lints)\n\n### Running tests\n\nYou can run tests with `yarn test`. We use [jest](https://jestjs.io/) and thus all [jest command line options](https://jestjs.io/docs/en/cli) can be used.\n\nIt is also possible to run tests against other environments (the default environment is testing against the local source code):\n\n- `yarn test:staging` – Test against `serlo-staging.dev`\n- `yarn test:production` – Test against `serlo.org`\n\n### Write tests\n\nAt [`__test__/__utils__`](./__tests__/__utils__) there are utility functions for writing tests:\n\n- [`fetch-helper.ts`](./__tests__/__utils__/fetch-helper.ts):\n  - `fetchSerlo()` - does an request at the current testing environment. For example when `TEST_ENVIRONMENT=staging` it makes a request at `*.serlo-staging.dev`. Use this function whenever possible. By setting `{ environment: TestEnvironment.Locally }` you can always test against the local environment.\n- [`epxect-helper.ts`](./__tests__/__utils__/expect-helper.ts): Various assertation helper you can use.\n\n### Run automatically all checks before pushing\n\nYou can use [git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) to automatically check your codebase before you push. In order to archieve this run the following commands in the root directory:\n\n```sh\necho 'yarn check:all --no-uncommitted-changes' \u003e .git/hooks/pre-push\nchmod +x .git/hooks/pre-push\n```\n\nYou can use the flag `--no-verify` like in `git push --no-verify` to bypass the checks while pushing.\n\n### Show preview of components\n\nIn order to show a preview of components you need run `yarn dev` and open `http://127.0.0.1:8787/___cloudflare_worker_dev`. When you want to add your own components for a preview you can add them at [`./src/cloudflare-worker-dev.tsx`](./src/cloudflare-worker-dev.tsx).\n\n## Preview Images\n\nVia `embed.serlo.org/thumbnail?url=${videoUrl|appletUrl}` you can request thumbnail images for supported providers (YouTube, Vimeo, Wikimedia Commons and Geogebra).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserlo%2Fcloudflare-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserlo%2Fcloudflare-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserlo%2Fcloudflare-worker/lists"}