feat(domain): add internalPath and stripPath properties to domain configuration

- Updated test files to include new properties `internalPath` and `stripPath` in domain configurations.
- Removed deprecated `createMultiPathDomain` function from the domain service to streamline the codebase.
This commit is contained in:
Mauricio Siu
2025-06-21 23:42:18 -06:00
parent b685a817fd
commit 7f0bdc7e00
3 changed files with 4 additions and 41 deletions

View File

@@ -19,6 +19,8 @@ describe("createDomainLabels", () => {
path: "/",
createdAt: "",
previewDeploymentId: "",
internalPath: "/",
stripPath: false,
};
it("should create basic labels for web entrypoint", async () => {

View File

@@ -119,6 +119,8 @@ const baseDomain: Domain = {
domainType: "application",
uniqueConfigKey: 1,
previewDeploymentId: "",
internalPath: "/",
stripPath: false,
};
const baseRedirect: Redirect = {

View File

@@ -201,44 +201,3 @@ export const validateDomain = async (
};
}
};
export const createMultiPathDomain = async (
applicationId: string,
domains: Array<{
host: string;
externalPath?: string;
internalPath: string;
port?: number;
https?: boolean;
stripPath?: boolean;
}>
) => {
const app = await findApplicationById(applicationId);
if (!app) {
throw new TRPCError({
code: "NOT_FOUND",
message: "Application not found",
});
}
const createdDomains = [];
for (const domainConfig of domains) {
const domain = await createDomain({
applicationId,
host: domainConfig.host,
path: domainConfig.externalPath || "/",
internalPath: domainConfig.internalPath,
port: domainConfig.port || 3000,
https: domainConfig.https || false,
stripPath: domainConfig.stripPath || false,
serviceName: app.appName,
domainType: "application",
certificateType: domainConfig.https ? "letsencrypt" : "none",
});
createdDomains.push(domain);
}
return createdDomains;
};