2
0

ci: 👷 Add connection pooling DB

This commit is contained in:
Baptiste Arnaud
2022-02-18 07:02:50 +01:00
parent 558a60329d
commit 1c178e01a6
3 changed files with 14 additions and 12 deletions

View File

@@ -1,11 +0,0 @@
import Mailgun from 'mailgun.js'
import formData from 'form-data'
export const initMailgun = () => {
const mailgun = new Mailgun(formData)
return mailgun.client({
username: 'api',
key: '0b024a6aac02d3f52d30999674bcde30-53c13666-e8653f58',
url: 'https://api.eu.mailgun.net',
})
}

View File

@@ -0,0 +1,13 @@
import { NextApiRequest, NextApiResponse } from 'next'
import Cors from 'cors'
import { initMiddleware, methodNotAllowed } from 'utils'
const cors = initMiddleware(Cors())
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
await cors(req, res)
if (req.method === 'GET') return res.status(200).send({ message: 'success' })
return methodNotAllowed(res)
}
export default handler