{"id":20446158,"url":"https://github.com/thorstenhans/spin-cors-sample","last_synced_at":"2026-06-06T19:31:50.535Z","repository":{"id":216809984,"uuid":"742409966","full_name":"ThorstenHans/spin-cors-sample","owner":"ThorstenHans","description":"Demonstrates how to implement CORS with Spin and Rust","archived":false,"fork":false,"pushed_at":"2024-01-12T12:27:07.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T16:57:11.894Z","etag":null,"topics":["fermyon-spin"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThorstenHans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-12T12:16:53.000Z","updated_at":"2024-04-27T11:37:21.000Z","dependencies_parsed_at":"2024-01-13T01:06:56.354Z","dependency_job_id":"d48d48b3-cf4e-484f-ba9b-e01c32e2eaa2","html_url":"https://github.com/ThorstenHans/spin-cors-sample","commit_stats":null,"previous_names":["thorstenhans/spin-cors"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThorstenHans/spin-cors-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorstenHans%2Fspin-cors-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorstenHans%2Fspin-cors-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorstenHans%2Fspin-cors-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorstenHans%2Fspin-cors-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThorstenHans","download_url":"https://codeload.github.com/ThorstenHans/spin-cors-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorstenHans%2Fspin-cors-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33997732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"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":["fermyon-spin"],"created_at":"2024-11-15T10:17:53.666Z","updated_at":"2026-06-06T19:31:50.510Z","avatar_url":"https://github.com/ThorstenHans.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spin CORS sample\n\nThis repository contains an example to illustrate how to implement CORS in a Spin application.\n\nThe app consists of two simple components\n\n- A backend component that exposes a REST API (`./api/`)\n- A frontend for testing purposes (`./frontend/`)\n\n## Running the sample\n\n### Backend\n\n```bash\ncd api\nspin build \u0026\u0026 spin up --sqlite @migration.sql --listen 0.0.0.0:3001\n```\n\n### Frontend\n\n```bash\ncd frontend\nspin build \u0026\u0026 spin up --listen 0.0.0.0:3000\n```\n\n## CORS configuration\n\nTo alter the CORS configuration, edit `./api/spin.toml`. See the following snippet showing all available options:\n\n```toml\n[component.api.variables]\ncors_allowed_origins = \"http://localhost:3000\"\ncors_allowed_methods = \"GET, POST, PUT, DELETE, OPTIONS\"\n# allow all headers\ncors_allowed_headers = \"*\"\n# cors_allowed_headers = \"Origin, X-Requested-With, Content-Type, Accept, Authorization\"\ncors_allow_credentials = \"true\"\ncors_max_age = \"3600\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorstenhans%2Fspin-cors-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthorstenhans%2Fspin-cors-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorstenhans%2Fspin-cors-sample/lists"}