So R2 also uses Cloudflare CDN? Is it good for video delivery?
So R2 also uses Cloudflare CDN? Is it good for video delivery?

images.yourdomain.com), and you upload an image with a key of something/image.png, the URL would be https://images.yourdomain.com/something/image.pngAccount.Workers R2 Storage permission that is required to set it up.
Free, Pro and Business customers have a limit of 512 MB.- Default Cache Behavior
For Enterprise customers the default maximum cacheable file size is 5 GB. Contact your account team to request a limit increase.




images.yourdomain.comsomething/image.pngAccount.Workers R2 Storageimport express from 'express';
import multer from 'multer';
import cors from 'cors';
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
import dotenv from 'dotenv';
const app = express();
const port = 4000;
app.use(cors());
dotenv.config();
const storage = multer.memoryStorage();
const upload = multer({
storage,
});
app.post('/upload', upload.single('file'), async (req, res) => {
const S3 = new S3Client({
region: 'auto',
endpoint: process.env.ENDPOINT,
credentials: {
accessKeyId: process.env.R2_ACCESS_KEY_ID,
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY,
},
});
await S3.send(
new PutObjectCommand({
Body: req.file.buffer,
Bucket: 'travelme',
Key: req.file.originalname,
ContentType: req.file.mimetype,
})
);
res.send('File Uploaded' + ' ' + req.file.originalname);
}); const [file, setFile] = useState('');
const handleChange = (e) => {
setFile(e.target.files[0]);
};
const handleSubmit = async (e) => {
e.preventDefault();
const formData = new FormData();
formData.append('file', file);
const response = await fetch('http://localhost:4000/upload', {
method: 'POST',
body: formData,
});
const message = await response.text();
console.log(message);
};