The handleQuery entry point function supports multiple object return types to return different types of answers. This page contains the various types of answers the function can return to respond to queries.
export default function handleQuery(query) {
if (query.request.geoLocation.country == "DE") {
return new ARecord("222.222.222.222", 30);
}
return new ARecord("111.111.111.111", 30);
}
declare class ARecord {
constructor(ip: string, ttl: number = 30);
/**
* The IP of the A record
*/
ip: string;
/**
* The TTL of the answer
*/
ttl: number;
}
declare class AaaaRecord {
constructor(ip: string, ttl: number = 30);
/**
* The IP of the AAAA record
*/
ip: string;
/**
* The TTL of the answer
*/
ttl: number;
}
declare class CnameRecord {
constructor(hostname: string, ttl: number = 30);
/**
* The hostname of the CNAME record
*/
hostname: string;
/**
* The TTL of the answer
*/
ttl: number;
}
declare class PullZoneRecord {
constructor(pullzone: string);
/**
* The name of the pull zone
*/
pullzone: string;
}
Was this page helpful?