Skip to content

Commit

Permalink
Fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
u4aew committed May 1, 2024
1 parent 1df23a2 commit 267a91f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 52 deletions.
55 changes: 3 additions & 52 deletions demo/api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const mocks = require('./mocks');

const proxy = {
_proxy: {
proxy: {},
Expand All @@ -15,57 +17,6 @@ const proxy = {
},
},
},
// Replace data from HTTP Spider
'GET /api/transactions/list': (req, res) => {
res.json([
{
id: 1,
date: '01.02.2023 16:05',
sum: '100.23',
currency: 'USD',
},
{
id: 2,
date: '01.02.2023 16:05',
sum: '100.23',
currency: 'USD',
},
]);
},

'GET /api/cards/list': (req, res) => {
res.json([
{
id: 1,
pan: '4111 3424 **** 3425',
expiry: '09/27',
name: 'John Smith',
ps: 'VISA',
},
{
id: 2,
pan: '4133 3424 **** 3425',
expiry: '09/29',
name: 'John Smith',
ps: 'VISA',
},
]);
},

'GET /api/transactions/details': (req, res) => {
res.json({
transactionId: 1,
date: '01.02.2023 16:05',
sum: '100.23',
currency: 'USD',
recipientName: 'John Doe',
recipientAccount: '123456789',
senderName: 'Jane Smith',
senderAccount: '987654321',
transactionType: 'Transfer',
description: 'Monthly rent payment',
status: 'Completed',
});
},
...mocks,
};
module.exports = proxy;
27 changes: 27 additions & 0 deletions demo/mocks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
'GET /api/transactions/list': (req, res) => {
res.json([
{ id: 1, date: '01.02.2023 16:05', sum: '100.23', currency: 'USD' },
{ id: 2, date: '01.02.2023 16:05', sum: '100.23', currency: 'USD' },
]);
},

'GET /api/cards/list': (req, res) => {
res.json([
{
id: 1,
pan: '4111 3424 **** 3425',
expiry: '09/27',
name: 'John Smith',
ps: 'VISA',
},
{
id: 2,
pan: '4133 3424 **** 3425',
expiry: '09/29',
name: 'John Smith',
ps: 'VISA',
},
]);
},
};

0 comments on commit 267a91f

Please sign in to comment.