Overview
This document describes how to request the COS service by using a non-default domain name.
Custom Origin Server Domain Name
The sample code below shows how to access a COS service using a custom origin server domain name.
Sample code
let region = "ap-beijing";
let customDomain = "exampledomain.com";
let cosXmlServiceConfig = {
region: region,
isDebuggable: false,
isHttps: true,
hostFormat: customDomain
};
await Cos.registerDefaultService(cosXmlServiceConfig)
Global Acceleration Domain Name
For more information on global acceleration, see Overview. The sample code below shows how to access a COS service using a global acceleration endpoint.
Sample code
let region = "ap-beijing";
let accelerate = true;
let cosXmlServiceConfig = {
region: region,
isDebuggable: false,
isHttps: true,
accelerate: accelerate
};
await Cos.registerDefaultService(cosXmlServiceConfig)
Apakah halaman ini membantu?