Let baseDomain be configured for Cloudflare and Deno Deploy

This commit is contained in:
Alex Gleason committed 2025-12-04 00:17:11 -06:00
1 parent bbb4a2534b
commit 2096c83b3c
9 files changed
+64 -7

No files matched your search

+5 -3
View File
@@ -46,6 +46,7 @@ export class CloudflareAdapter implements DeployAdapter {
private apiKey: string;
private accountId: string;
private baseURL: string;
private baseDomain: string;
private projectName?: string;
private corsProxy?: string;
@@ -54,6 +55,7 @@ export class CloudflareAdapter implements DeployAdapter {
this.apiKey = config.apiKey;
this.accountId = config.accountId;
this.baseURL = config.baseURL || 'https://api.cloudflare.com/client/v4';
this.baseDomain = config.baseDomain || 'workers.dev';
this.projectName = config.projectName;
this.corsProxy = config.corsProxy;
}
@@ -118,11 +120,11 @@ export class CloudflareAdapter implements DeployAdapter {
// Step 5: Enable the workers.dev subdomain for this script
await this.enableWorkersDevSubdomain(scriptName);
// Step 6: Get the account's workers.dev subdomain
// Step 6: Get the account's workers subdomain
const subdomain = await this.getWorkersSubdomain();
// Construct the URL
const workerUrl = `https://${scriptName}.${subdomain}.workers.dev`;
// Construct the URL using the configurable base domain
const workerUrl = `https://${scriptName}.${subdomain}.${this.baseDomain}`;
return {
url: workerUrl,
+3 -1
View File
@@ -33,6 +33,7 @@ export class DenoDeployAdapter implements DeployAdapter {
private apiKey: string;
private organizationId: string;
private baseURL: string;
private baseDomain: string;
private projectName?: string;
private corsProxy?: string;
@@ -41,6 +42,7 @@ export class DenoDeployAdapter implements DeployAdapter {
this.apiKey = config.apiKey;
this.organizationId = config.organizationId;
this.baseURL = config.baseURL || 'https://api.deno.com/v1';
this.baseDomain = config.baseDomain || 'deno.dev';
this.projectName = config.projectName;
this.corsProxy = config.corsProxy;
}
@@ -66,7 +68,7 @@ export class DenoDeployAdapter implements DeployAdapter {
await this.collectFiles(distPath, '', assets);
// Step 3: Create deployment with assets and domain
const domain = `${project.name}.deno.dev`;
const domain = `${project.name}.${this.baseDomain}`;
const deployment = await this.createDeployment(project.id, assets, domain);
return {
+2
View File
@@ -60,6 +60,7 @@ export interface CloudflareDeployConfig {
apiKey: string;
accountId: string;
baseURL?: string;
baseDomain?: string;
projectName?: string;
corsProxy?: string;
}
@@ -69,6 +70,7 @@ export interface DenoDeployConfig {
apiKey: string;
organizationId: string;
baseURL?: string;
baseDomain?: string;
projectName?: string;
corsProxy?: string;
}