Files
pfadi-bussle/pages/api/mailtrigger.ts
Thomas Ruoff f9e0a33f3b more tweaking
2022-06-23 23:57:47 +02:00

21 lines
483 B
TypeScript

import { log } from '../../helpers/log'
import { NextApiRequest, NextApiResponse } from 'next'
export default async function useHandler(
req: NextApiRequest,
res: NextApiResponse
): Promise<void> {
const { method } = req
switch (method) {
case 'GET':
log.info('sending mail triggered')
res.status(200).end('DONE')
res.end()
break
default:
res.setHeader('Allow', ['GET'])
res.status(405).end(`Method ${method} Not Allowed`)
}
}