mirror of
https://github.com/Lissy93/web-check.git
synced 2025-08-08 20:54:30 +02:00
Update API endpoints to read URL params from either option
This commit is contained in:
@ -4,7 +4,8 @@ const dnsPromises = dns.promises;
|
||||
const axios = require('axios');
|
||||
|
||||
exports.handler = async (event) => {
|
||||
const domain = event.queryStringParameters.url.replace(/^(?:https?:\/\/)?/i, "");
|
||||
const url = (event.queryStringParameters || event.query).url;
|
||||
const domain = url.replace(/^(?:https?:\/\/)?/i, "");
|
||||
try {
|
||||
const addresses = await dnsPromises.resolve4(domain);
|
||||
const results = await Promise.all(addresses.map(async (address) => {
|
||||
|
Reference in New Issue
Block a user