mirror of
https://github.com/Lissy93/web-check.git
synced 2025-08-12 14:07:13 +02:00
Update API endpoints to read URL params from either option
This commit is contained in:
@ -2,8 +2,9 @@ const axios = require('axios');
|
||||
const xml2js = require('xml2js');
|
||||
|
||||
exports.handler = async (event) => {
|
||||
const baseUrl = event.queryStringParameters.url.replace(/^(?:https?:\/\/)?/i, "");
|
||||
const url = baseUrl.startsWith('http') ? baseUrl : `http://${baseUrl}`;
|
||||
const url = (event.queryStringParameters || event.query).url;
|
||||
// const baseUrl = event.queryStringParameters.url.replace(/^(?:https?:\/\/)?/i, "");
|
||||
// const url = baseUrl.startsWith('http') ? baseUrl : `http://${baseUrl}`;
|
||||
let sitemapUrl;
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user