Greetings, I am new to spaces and pretty much excited what DO is accomplishing . Setup and upload was easy using node.js aws-sdk, I have few large JSON files which I want to serve API-Like for the client Unfortunately I don’t know how to setup CORS for such application Please advice Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
@rudixlab we just added support for CORS configuration via the UI this week. You can find it on the ‘Settings’ tab of any Space. Hope this helps!
This comment has been deleted
seems like I fixed it using AWS sdk with node.js
const thisConfig = {
AllowedMethods: ['GET', 'POST', 'PUT', 'HEAD'],
AllowedOrigins: ['*'],
ExposeHeaders: [],
MaxAgeSeconds: 3000,
};
const corsRules = new Array(thisConfig);
const corsParams = {
Bucket: 'bucket-name',
CORSConfiguration: { CORSRules: corsRules },
};
// set the new CORS configuration on the selected bucket
s3.putBucketCors(corsParams, (err, data) => {
if (err) {
console.log('Error', err);
} else {
console.log('Success', data);
}
});
}
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.