In this recipe, we will be using the getHttp function from the fetchApi wrapper we made in the 'Creating a wrapper for the Fetch API as an HTTP client' recipe.
Work through the next steps and sections to create your MirageJS mock server:
Install the MirageJS server to your packages. You need to open Terminal (macOS or Linux) or Command Prompt/PowerShell (Windows) and execute the following command:
> npm install --save miragejs
The version used in this recipe was 0.1.32. Watch for any changes to MirageJS, as there are no current LTS versions of the library yet.
Now in the following sections, we will create each one of the HTTP methods that will be mocked by the MirageJS server.