By skaniras
I just setup my first Space, connected my Parse Server to it and everything works, but I’m not sure I have enabled anything CDN-wise, or if I have to.
I’m using the configuration below
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var path = require('path');
var S3Adapter = require('parse-server').S3Adapter;
var AWS = require("aws-sdk");
var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;
//Set Digital Ocean Spaces EndPoint
const spacesEndpoint = new AWS.Endpoint('https://fra1.digitaloceanspaces.com');
//Define S3 options
var s3Options = {
bucket: 'bucket',
baseUrl: 'https://bucket.fra1.digitaloceanspaces.com',
region: 'fra1',
directAccess: true,
globalCacheControl: "public, max-age=31536000",
s3overrides: {
accessKeyId: 'accessKeyId',
secretAccessKey: 'secretAccessKey',
endpoint: spacesEndpoint
}
};
var s3Adapter = new S3Adapter(s3Options);
var api = new ParseServer({
publicServerURL: 'http://ip:1338/parse',
filesAdapter: s3Adapter
});
Any thoughts will be much appreciated!
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!
No sir.Please use this:<bucketName>.<region>.cdn.digitaloceanspaces.com.But if you use as endpoint,you can just use <region>.digitaloceanspaces.com,CDN is not allowed.
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.