Files
inventory/inventory-server/old/test-connection.js
2025-10-04 16:14:09 -04:00

22 lines
640 B
JavaScript

const express = require('express');
const router = express.Router();
const { testConnection } = require('../../scripts/test-prod-connection');
router.get('/test-prod-connection', async (req, res) => {
try {
const productCount = await testConnection();
res.json({
success: true,
message: 'Successfully connected to production database',
productCount
});
} catch (error) {
console.error('Production connection test failed:', error);
res.status(500).json({
success: false,
error: error.message || 'Failed to connect to production database'
});
}
});
module.exports = router;