proxy.config.js 723 Bytes
Newer Older
bert committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
// Learn more on how to config.
// - https://github.com/dora-js/dora-plugin-proxy#规则定义

module.exports = {
  '/api/todos': function(req, res) {
    setTimeout(function() {
      res.json({
        success: true,
        data: [
          {
            id: 1,
            text: 'Learn antd',
            isComplete: true,
          },
          {
            id: 2,
            text: 'Learn ant-tool',
          },
          {
            id: 3,
            text: 'Learn dora',
          },
        ],
      });
    }, 500);
  },
bert committed
27 28 29 30 31 32 33 34 35 36
  '/api/login': function(req, res) {
    setTimeout(function() {
      res.json({
        success: true,
        data: {
          user: 'admin'
        },
      });
    }, 500);
  }
bert committed
37
};