JSON parsing in API endpoints

This commit is contained in:
Alicia Sykes
2024-05-18 15:01:52 +01:00
parent cc510bd281
commit cb8db0b1f5
3 changed files with 7 additions and 5 deletions

View File

@ -33,12 +33,12 @@ const linkedPagesHandler = async (url) => {
if (internalLinks.length === 0 && externalLinks.length === 0) {
return {
statusCode: 400,
body: JSON.stringify({
body: {
skipped: 'No internal or external links found. '
+ 'This may be due to the website being dynamically rendered, using a client-side framework (like React), and without SSR enabled. '
+ 'That would mean that the static HTML returned from the HTTP request doesn\'t contain any meaningful content for Web-Check to analyze. '
+ 'You can rectify this by using a headless browser to render the page instead.',
}),
},
};
}