mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 22:47:15 +01:00
21 lines
483 B
TypeScript
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`)
|
|
}
|
|
}
|