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

@ -2,7 +2,7 @@ const puppeteer = require('puppeteer-core');
const chromium = require('chrome-aws-lambda');
const middleware = require('./_common/middleware');
const screenshotHandler = async (targetUrl) => {
const handler = async (targetUrl) => {
if (!targetUrl) {
throw new Error('URL is missing from queryStringParameters');
@ -58,4 +58,5 @@ const screenshotHandler = async (targetUrl) => {
}
};
exports.handler = middleware(screenshotHandler);
module.exports = middleware(handler);
module.exports.handler = middleware(handler);