mirror of
https://github.com/Lissy93/web-check.git
synced 2025-08-08 20:54:30 +02:00
Convert all API endpoints into ESM modules
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
const https = require('https');
|
||||
const { performance, PerformanceObserver } = require('perf_hooks');
|
||||
const middleware = require('./_common/middleware');
|
||||
import https from 'https';
|
||||
import { performance, PerformanceObserver } from 'perf_hooks';
|
||||
import middleware from './_common/middleware.js';
|
||||
|
||||
const handler = async (url) => {
|
||||
const statusHandler = async (url) => {
|
||||
if (!url) {
|
||||
throw new Error('You must provide a URL query parameter!');
|
||||
}
|
||||
@ -55,5 +55,5 @@ const handler = async (url) => {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = middleware(handler);
|
||||
module.exports.handler = middleware(handler);
|
||||
export const handler = middleware(statusHandler);
|
||||
export default handler;
|
||||
|
Reference in New Issue
Block a user