index.js 546 B

123456789101112131415161718192021222324252627282930
  1. const mockConfig = require('./mockData.js');
  2. const mockObj = {
  3. getList: function() {
  4. return mockConfig.getMockDataList();
  5. },
  6. getData: function(key) {
  7. return mockConfig.getMockData(key);
  8. },
  9. add: function(key, config) {
  10. return mockConfig.addMockData(key, config);
  11. },
  12. remove: function(key) {
  13. return mockConfig.removeMockData(key);
  14. },
  15. isDev: function() {
  16. return process.env.NODE_ENV === 'development';
  17. },
  18. getServerUrl: function() {
  19. return 'http://localhost:3001';
  20. }
  21. };
  22. module.exports = mockObj;