Replace AWS Lambda adapter with custom function

This commit is contained in:
2023-07-06 13:08:59 +02:00
parent 22b75f6c3f
commit 123f2b78ee
6 changed files with 54 additions and 20 deletions

View File

@@ -0,0 +1,22 @@
import type { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';
import { createProbot } from 'probot';
import { appFn } from '../../appFn';
const privateKey = (process.env.PRIVATE_KEY as string).replace(/\\n/gm, '\n');
const handler: Handler = async (
event: HandlerEvent,
context: HandlerContext
) => {
const probot = createProbot({ overrides: { privateKey } });
await appFn(probot);
return {
statusCode: 200,
body: 'Playlist Entry Validator by Maciej Pędzich'
};
};
export { handler };