Because as Kian mentioned the SPA does
Because as Kian mentioned the SPA does not have a server so the cors approach would never really work as the 'client' can't really respond (if i got it correctly)
aws s3api put-bucket-cors --bucket <bucketName> --cors-configuration file://cors.json --endpoint-url https://<accountid>.r2.cloudflarestorage.comaws s3api get-bucket-cors --bucket <bucketName> --endpoint-url https://<accountid>.r2.cloudflarestorage.com{
"CORSRules": [
{
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"localhost:5173"
]
}
]
}...from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.localhost:5173http:localhost:5173http:package.json"scripts": {
"cors:set": "aws s3api put-bucket-cors --bucket <BucketName> --cors-configuration file://cors.json --endpoint-url https://<UserID>.r2.cloudflarestorage.com",
"cors:get": "aws s3api get-bucket-cors --bucket <BucketName> --endpoint-url https://<UserID>.r2.cloudflarestorage.com"<BucketName><UserID>cors.jsonCORSCORS{
"CORSRules": [{
"AllowedOrigins": ["http://localhost:3000"],
"AllowedMethods": ["GET"],
"AllowedHeaders": []
}]
}npm run cors:setnpm run cors:gethttp:// s3.send(
new PutBucketCorsCommand({
Bucket: "bucket",
CORSConfiguration: {
CORSRules: [
{
AllowedOrigins: ["origin.com", "localhost:3000"],
AllowedMethods: ["GET"],
AllowedHeaders: [],
},
],
},
})
);