Skip to content

Commit

Permalink
fix: make sure production build doesn't error because of missing dns …
Browse files Browse the repository at this point in the history
…manger.
  • Loading branch information
zicklag committed Oct 20, 2024
1 parent 29a6a7f commit 30d1b97
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/lib/dns/dns-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ export interface DnsManagementAPI {
deleteRecords(ops: { host: string; type: DnsRecordType }): Promise<void>;
}

function createDnsManager() {
if (!dev) throw 'TODO: production dns manager';

function createDevDnsManager() {
const store = startDevDnsServer();

const dnsKey = (host: string, type: DnsRecordType): string => `${type}--${host}`;
Expand All @@ -42,4 +40,23 @@ function createDnsManager() {
};
}

function createProdDnsManager() {
return {
async createRecord({ host, type, value }: DnsRecord) {
throw 'TODO: implement prod dns manager';
},
async deleteRecords({ host, type }: { host: string; type: DnsRecordType }) {
throw 'TODO: implement prod dns manager';
}
};
}

function createDnsManager() {
if (dev) {
return createDevDnsManager();
} else {
return createProdDnsManager();
}
}

export const dnsManager: DnsManagementAPI = createDnsManager();

0 comments on commit 30d1b97

Please sign in to comment.