Convert all API endpoints into ESM modules

This commit is contained in:
Alicia Sykes
2024-05-06 21:51:32 +01:00
parent e255c358cb
commit c9e57400fd
34 changed files with 191 additions and 194 deletions

View File

@ -1,7 +1,7 @@
const https = require('https');
const middleware = require('./_common/middleware'); // Make sure this path is correct
import https from 'https';
import middleware from './_common/middleware.js';
const handler = async (domain) => {
const dnsSecHandler = async (domain) => {
const dnsTypes = ['DNSKEY', 'DS', 'RRSIG'];
const records = {};
@ -53,5 +53,5 @@ const handler = async (domain) => {
return records;
};
module.exports = middleware(handler);
module.exports.handler = middleware(handler);
export const handler = middleware(dnsSecHandler);
export default handler;