mirror of
https://github.com/Lissy93/web-check.git
synced 2025-08-18 08:29:52 +02:00
Convert all API endpoints into ESM modules
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const dns = require('dns').promises;
|
||||
const middleware = require('./_common/middleware');
|
||||
import dns from 'dns/promises';
|
||||
import middleware from './_common/middleware.js';
|
||||
|
||||
const handler = async (url, event, context) => {
|
||||
const txtRecordHandler = async (url, event, context) => {
|
||||
try {
|
||||
const parsedUrl = new URL(url);
|
||||
|
||||
@@ -29,5 +29,5 @@ const handler = async (url, event, context) => {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = middleware(handler);
|
||||
module.exports.handler = middleware(handler);
|
||||
export const handler = middleware(txtRecordHandler);
|
||||
export default handler;
|
||||
|
Reference in New Issue
Block a user