Updates all API functions, to work on both Vercel & Netlify

This commit is contained in:
Alicia Sykes
2023-09-03 12:27:04 +01:00
parent 3695c82472
commit 1a95a42853
33 changed files with 101 additions and 55 deletions

View File

@ -1,7 +1,7 @@
const https = require('https');
const commonMiddleware = require('./_common/middleware'); // Make sure this path is correct
const middleware = require('./_common/middleware'); // Make sure this path is correct
const fetchDNSRecords = async (domain, event, context) => {
const handler = async (domain) => {
const dnsTypes = ['DNSKEY', 'DS', 'RRSIG'];
const records = {};
@ -49,4 +49,6 @@ const fetchDNSRecords = async (domain, event, context) => {
return records;
};
exports.handler = commonMiddleware(fetchDNSRecords);
module.exports = middleware(handler);
module.exports.handler = middleware(handler);