{"id":30184648,"url":"https://github.com/studyresearchprojects/rusty-cloudflare-worker","last_synced_at":"2025-08-12T12:44:00.820Z","repository":{"id":52864906,"uuid":"309159085","full_name":"StudyResearchProjects/rusty-cloudflare-worker","owner":"StudyResearchProjects","description":"👷🏻‍♂️ A copy of the @cloudflare @rust-lang template with HTTP primitives OOTB for you Cloudflare Worker to work with Rust","archived":false,"fork":false,"pushed_at":"2021-04-25T02:54:04.000Z","size":251,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T01:01:21.508Z","etag":null,"topics":["cloudflare","rust","workers"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/StudyResearchProjects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-01T18:16:52.000Z","updated_at":"2025-08-03T21:51:57.000Z","dependencies_parsed_at":"2022-08-23T09:41:57.402Z","dependency_job_id":null,"html_url":"https://github.com/StudyResearchProjects/rusty-cloudflare-worker","commit_stats":null,"previous_names":["leoborai/rusty-cloudflare-worker","studyresearchprojects/rusty-cloudflare-worker"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/StudyResearchProjects/rusty-cloudflare-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudyResearchProjects%2Frusty-cloudflare-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudyResearchProjects%2Frusty-cloudflare-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudyResearchProjects%2Frusty-cloudflare-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudyResearchProjects%2Frusty-cloudflare-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StudyResearchProjects","download_url":"https://codeload.github.com/StudyResearchProjects/rusty-cloudflare-worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudyResearchProjects%2Frusty-cloudflare-worker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270064272,"owners_count":24520929,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","rust","workers"],"created_at":"2025-08-12T12:43:51.725Z","updated_at":"2025-08-12T12:44:00.781Z","avatar_url":"https://github.com/StudyResearchProjects.png","language":"Rust","readme":"\u003cdiv\u003e\n  \u003cdiv align=\"center\" style=\"display: block; text-align: center;\"\u003e\n    \u003cimg src=\"./assets/ferris_wasm.png\" width=\"200\" /\u003e\n  \u003c/div\u003e\n  \u003ch1 align=\"center\"\u003erusty-cloudflare-worker\u003c/h1\u003e\n  \u003ch4 align=\"center\"\u003e👷🏻‍♂️ Rust Cloudflare Worker to handle HTTP requests\u003c/h4\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./assets/screenshot.png\" width=\"700\" /\u003e\n\u003c/div\u003e\n\n## Motivation\n\nThe Rusty Cloudflare Worker is an template project to have a Cloudflare worker\nwhich makes use of Rust and WASM to handle your HTTP requests.\n\nThe only relevant difference between this worker and the template from\nCloudflare (Available [here](https://github.com/cloudflare/rustwasm-worker-template)) is:\n\n- This template will take the HTTP request and pass it to Rust via JSON, this\nmeans you will have an array of bytes and you limit yourself to rely on plain\ndata. Theres no support (at the moment of this writing) for binary data.\n\n- The HTTP `Request` object from JavaScript it turned into a `http::Request\u003cT\u003e`\ninstance, which means you are able to consume the API from `http::Request\u003cT\u003e`.\n\n- The HTTP response is built from a `http::Response` struct from the `http`\ncrate as well.\n\nIf you don't rely on consuming the incoming HTTP Request then the:\nhttps://github.com/cloudflare/rustwasm-worker-template is your best bet.\n\nI think that theres more we can do for performance inside of the `src/core`\ndirectory.\n\n## Requirements\n\n- NodeJS: Scripts under the `script/` directory require NodeJS/NPM in order to\nexecute the `npx` command.\n- Rust\n\n## Usage\n\n1. Create your project by clicking on: `Use template` button up there.\n\n2. In your repository settings section you must provide the following\nsecrets:\n\nSecret | Description\n--- | ---\nCF_EMAIL | Cloudflare user email\nCF_API_KEY | Cloudflare Global API Key. Check on `scripts/publish.sh` to change this behavior.\nCF_ACCOUNT_ID | Cloudflare Account ID\nCF_ZONE_ID | Cloudflare Zone ID\n\nThese secrets are used by the `.github/workflows/deploy.yml` file, when a new\nrelease is created. If you want to change that refer to: `.github/workflows/deploy.yml`.\n\n3. Clone the project locally, the logic for your application should live in\nthe `src/app` directory. The `src/app/mod.rs` file contains the logic to receive\na `http::Request` and return a `http::Response`.\n\n4. When you are done with your implementation release your worker by pushing a\ntag prefixed with `v` as follows:\n\n```sh\ngit tag -a  v0.1.0 -m \"First release\"\n\ngit push origin main --follow-tags\n```\n\nIf nothing is changed in the `deploy` workflow, this should trigger a deploy.\n\n## Scripts\n\nSome scripts are available to help you in your workflow. These scripts are\navailable in the `scripts/` directory.\n\nFilename | Description\n--- | ---\n`build.sh` | Runs `@cloudflare/wrangler build` to build your worker\n`make-wrangler.sh` | Creates a `wrangler.toml` file\n`publish.sh` | Publishes your worker using `@cloudflare/wrangler publish`. You must provide: `CF_EMAIL` with your cloudflare account email and `CF_API_KEY` with your Global API Key. Refer to: https://developers.cloudflare.com/workers/cli-wrangler/authentication#using-environment-variables for more details in case you want to change this behavior.\n`wrangler-dev.sh` | Runs your worker locally. You must provide the Account ID to the `wrangler.toml` file\n`wrangler-preview.sh` | Uploads your worker to a preview environment with tools for debugging.\n\n## Considerations\n\n### Wrangler Dev\n\nIf you run the `scripts/wrangler-dev.sh` file you will have an `ACCOUNT_ID` to\nthe `wrangler.toml`.\n\nOtherwise you will get:\n\n```sh\n$ scripts/wrangler-dev.sh\n\n🕵️  You can find your account_id in the right sidebar of your account's Workers page\nError: field `account_id` is required to deploy to workers.dev\n```\n\nAs a workaround you can always use `scripts/wrangler-preview.sh` instead.\n\n## Contributions\n\nAll contributions to this project are welcome. Don't hesitate to either create\na Pull Request, or Issue as you require.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudyresearchprojects%2Frusty-cloudflare-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudyresearchprojects%2Frusty-cloudflare-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudyresearchprojects%2Frusty-cloudflare-worker/lists"}