Skip to content

[Question] How to skip certain URL (some URL use mock data and some still go to real API )?  #169

@yanzou

Description

@yanzou

Hi team, thanks for this great tool!
I would like to ask a more detail question reguarding to the fake-response example:

Say I working a new feature work with a new API entry api/newFeature, so I would like mock only this new API entry:

xhook.before(function(request, callback) {
   swtich (request.url) {
      case 'api/newFeature': 
          callback({
             status: 200,
             text: JSON.stringify({ hello: 'world' }),  // mock data, so I have to wait for API team's code
                ...
          });
         break;

       default: 
          ???    // <------- how can I let other URL by passed and get real API resonse ?
          break;
   }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions