mirror of
https://github.com/Lissy93/web-check.git
synced 2025-08-08 20:54:30 +02:00
JSON parsing in API endpoints
This commit is contained in:
@ -2,6 +2,8 @@ import dns from 'dns';
|
||||
import URL from 'url-parse';
|
||||
import middleware from './_common/middleware.js';
|
||||
|
||||
// TODO: Fix.
|
||||
|
||||
const mailConfigHandler = async (url, event, context) => {
|
||||
try {
|
||||
const domain = new URL(url).hostname || new URL(url).pathname;
|
||||
@ -70,7 +72,7 @@ const mailConfigHandler = async (url, event, context) => {
|
||||
} else {
|
||||
return {
|
||||
statusCode: 500,
|
||||
body: JSON.stringify({ error: error.message }),
|
||||
body: { error: error.message },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user