// Step 1: Import required modules
const express = require('express');
const bodyParser = require('body-parser');
const axios = require('axios');
// Step 2: Create an instance of Express
const app = express();
// Step 3: Use bodyParser middleware for parsing JSON requests
app.use(bodyParser.json());
// Step 4: Define a route to handle SAP Concur webhook events
app.post('/concur/webhook', (req, res) => {
// Step 5: Extract data from the incoming Concur webhook payload
const eventData = req.body;
// Step 6: Process the Concur webhook data as needed
// (Add your business logic here)
// Step 7: Send a response to Concur acknowledging the webhook event
res.status(200).json({ message: 'Webhook event received successfully' });
});
// Step 8: Set up the Express server to listen on a specific port
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});