Replace AWS Lambda adapter with custom function
This commit is contained in:
22
netlify/functions/validate-pr.ts
Normal file
22
netlify/functions/validate-pr.ts
Normal 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 };
|
||||
Reference in New Issue
Block a user