remove trailing slash again, log when eopage hook was recieved

This commit is contained in:
Ulf Gebhardt 2022-01-12 08:56:05 +01:00
parent 18256e02ca
commit 41ee819aba
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 3 additions and 2 deletions

View File

@ -73,7 +73,7 @@ const createServer = async (context: any = serverContext): Promise<any> => {
})
// Elopage Webhook
app.post('/hook/elopage/' + CONFIG.WEBHOOK_ELOPAGE_SECRET + '/', elopageWebhook)
app.post('/hook/elopage/' + CONFIG.WEBHOOK_ELOPAGE_SECRET, elopageWebhook)
// Github Webhook
if (CONFIG.WEBHOOK_GITHUB) {
app.post(

View File

@ -28,13 +28,14 @@
*/
import { LoginElopageBuys } from '@entity/LoginElopageBuys'
import { LoginUser } from '@entity/LoginUser'
import { getCustomRepository } from 'typeorm'
import { UserResolver } from '../graphql/resolver/UserResolver'
import { LoginElopageBuysRepository } from '../typeorm/repository/LoginElopageBuys'
import { LoginUserRepository } from '../typeorm/repository/LoginUser'
export const elopageWebhook = async (req: any, res: any): Promise<void> => {
// eslint-disable-next-line no-console
console.log('Elopage Hook received')
res.status(200).end() // Responding is important
const loginElopgaeBuyRepository = await getCustomRepository(LoginElopageBuysRepository)
const loginElopgaeBuy = new LoginElopageBuys()