Http Fake Backend Versions Save

Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.

3.2.0

7 years ago

Changes

  • 2e658aee Add note about Yarn into the readme
  • 91846448 Use Yarn on Travis
  • f0856f82 Add yarn lock file
  • a83d5a87 Update dependencies
  • 67775831 Rename sublime settings file

New Feature: Reproducible installations

Thanks to the lock file provided by Yarn. That’s it. Not sure about tagging this as feature release.

Keep in mind that you of course still can install with npm 💖

3.1.0

7 years ago

Changes

  • ce7b6bef Update docs and example
  • a42758f5 Feature: Improve fakability of http status codes
  • 25ba9d60 Rename existing examples
  • b07bc61d Update and pin dependencies

New Feature: Improve fakability of HTTP status codes

You now can define different status codes on request level in addition to defining errors on endpoint level.

So different subroutes of one endpoint can return different HTTP status codes. Plus you can choose between:

  • a status code with a self defined response
  • a status code with a predefined error object provided by boom

Example

const SetupEndpoint = require('./setup/setup.js');

module.exports = SetupEndpoint({
    name: 'statusCodes',
    urls: [
        {
            params: '/boomError',
            requests: [{
                // Returns a 402 status code + error message provided by boom:
                // {
                //   "error" : "Payment Required",
                //   "statusCode" : 402
                // }
                statusCode: 402
            }]
        },
        {
            params: '/customError',
            requests: [{
                // Returns a HTTP status code 406 and a self defined response:
                response: { error: true },
                statusCode: 406
            }]
        },
        {
            params: '/regularResponse',
            requests: [{
                // Returns a 401 error provided by boom
                // as defined on endpoint level
                response: '/json-templates/anotherExample.json'
            }]
        }
    ],
    statusCode: 401
});

3.0.7

7 years ago

Changes

  • 8d5b30d2 Add test for defining multiple Methods in an array
  • 70e3d2e4 Update dependencies

3.0.6

7 years ago

Changes

  • a1110b26 Update examples
  • 11b5bf2d Fix linting errors
  • d6522c4c Update dependencies

3.0.5

7 years ago

Changes

  • 00e3f097 Update dependencies
  • bfd9c1eb Fix typos in readme

3.0.4

7 years ago

Changes

  • a3faf465 Update dependencies

3.0.3

8 years ago

Changes

  • e1c47874 Bring back formatting of time stamps :kissing:

3.0.2

8 years ago

Changes

  • 88810c66 Adapt breaking changes from good 7.0.0
  • 320ff17f Add Node.js v6 to travis config
  • 2a0100e5 Update dependencies
  • c99eb5a2 Update README

3.0.1

8 years ago

Changes

  • 6e356854 Update Readme
  • 51cfb46c Add info when no endpoints are configured
  • f2774f06 Add link to hapi docs regarding path params

3.0.0

8 years ago

Changes

  • c3b6d11b Feature: Different methods on the same route
    • It's also possible to return different responses for those different methods. Closes #1

Breaking change because the configuration object changed again. See README.