mdasberg / ng-apimock

Node plugin that provides the ability to use scenario based api mocking: for local development for protractor testing
MIT License
99 stars 26 forks source link

How to mock images via ng-apimock? #70

Closed ghost closed 5 years ago

ghost commented 5 years ago

How to mock images via ng-apimock?

mdasberg commented 5 years ago

Hi @Ts-alan, you can use api mock to return an image like this:

{
  "expression": "some/url",
  "method": "GET",
  "name": "my-image-mock",
  "responses": {
    "image": {
      "default": true,
      "file": "path/to/image.png",
      "headers": {
        "Content-type": "image/png"
      }
    }
  }
}