Running Mimic Debugger Remotely

Introduction

If you want to open the Mimic debugger in a separate window you can do so using the remote debugging feature of Mimic.

To do this you need to install Mimic remote server.


  # Install Mimic remote server globally
  npm install -g mimic-remote

              

Running Mimic remote server

To run Mimic remote server all you need to do is run:


  # Running Mimic remote server
  mimic-remote

  # You can also run it under a different port (by default 5000)
  mimic-remote -p 4000

              

Setting up Mimic remote in your application

In your application you need to import the connect function in order to connect to the Mimic remote server.

Instead of importing mimic directly you need to import mimic/remote.


  # Importing mimic remote
  import connect from 'mimic/remote';

  # Connecting to Mimic remote server
  connect()

  # You can also configure a different host and port
  connect({ host: 'localhost', port: 5000 })

              

Start Mocking!

We're all finished with installation, point your browser to http://localhost:5000 and start mocking.

It is important to note that Mimic will hold off all your application requests until Mimic is open in your browser window.

This is a current limitation of the implementation to allow you to mock any request that goes out at the start of the application.

JS.ORG Logo