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

@ -83,7 +83,7 @@ const fetchFromMyAPI = async (hostname) => {
}
};
const fetchWhoisData = async (url) => {
const handler = async (url) => {
if (!url.startsWith('http://') && !url.startsWith('https://')) {
url = 'http://' + url;
}
@ -106,4 +106,6 @@ const fetchWhoisData = async (url) => {
};
};
exports.handler = middleware(fetchWhoisData);
module.exports = middleware(handler);
module.exports.handler = middleware(handler);