Skip to content

Commit

Permalink
fix: url regex and add url and img routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bedon committed Sep 27, 2023
1 parent a2057f5 commit bd268a0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion server/live-loan-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,22 @@ module.exports = function liveLoanRouter(cache) {
});
});

// Loan Id URL Router
router.use('/lid/:id([0-9]{0,})/url', async (req, res) => {
await tracer.trace('live-loan.loanid.redirectToUrl', { resource: req.path }, async () => {
await redirectToUrl('loanid', cache, req, res);
});
});

// Loan Id IMG Router (Legacy)
router.use('/lid/:id([0-9]{0,})/img', async (req, res) => {
await tracer.trace('live-loan.loanid.serveImg', { resource: req.path }, async () => {
await serveImg('loanid', 'legacy', cache, req, res);
});
});

// Loan Id IMG Router (Kiva Classic)
router.use('/lid/:id([a-zA-Z0-9.%,_-]{0,})/img2', async (req, res) => {
router.use('/lid/:id([0-9]{0,})/img2', async (req, res) => {
await tracer.trace('live-loan.loanid.serveImg', { resource: req.path }, async () => {
await serveImg('loanid', 'classic', cache, req, res);
});
Expand Down

0 comments on commit bd268a0

Please sign in to comment.