mirror of
https://github.com/maciejpedzich/playlist-entry-validator.git
synced 2024-09-20 02:56:19 +02:00
23 lines
532 B
TypeScript
23 lines
532 B
TypeScript
|
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 };
|