I'm sorry. Did you say v2?
Oh dear. How much time is it going to take me to "upgrade" my code?
Wait, what? Then why did you bump the major version?
This release opens all kinds of exciting doors.
See below for details, but there are three major reasons to upgrade.
--localOnly
and --ipWhitelist
CLI flags.http
, but will be out
of process to mountebank itself. You tell mountebnak about your custom implementation with the
new --protofile
command line flag.
This is Yuge!
state
parameters passed into the response injection function (I never documented one. The
documented one did not share state with predicates; the undocumented one did). While you can continue
to use the old interface, the new interface is much cleaner, accepting a single JSON parameter that
contains all relevant information. That interface now cleanly shares state between predicate and response
injection and allows for much easier evolution of injection functions (including adding async capability
to predicate injection and decorate behaviors).--localOnly
CLI flag, which limits all connections
to the loopback interface (e.g., localhost). You should ALWAYS do that when running mountebank directly on your
developer machine, and use the --ipWhitelist
flag in other scenarios.
Unfortunately, neither of these flags worked in v1. I'm sorry. That's an embarrassing security vulnerability.
They are both verified by a series of automated tests now, and verified to work with both the mountebank server itself
and all imposter sockets.
GET /imposters/:port?replayable=true
now returns the value of
recordRequests
.--mock
CLI flag no longer changes the imposter-level value of recordRequests
--host
command line flag wasn't being reflected in the logs or mountebank URLs, and it
wasn't applying to imposters.endOfRequestResolver
wait
behavior was set to more than about 2 minutesnulls
now work with copy
behaviorstext
fieldMany thanks to the following kind folks for help with this release, either through bug reports, suggestions, or direct code contributions:
npm install -g mountebank@<%= releaseVersion %>
or:
Option | node.js required? | sudo required? | links | Description |
---|---|---|---|---|
Self-contained archives | No | No | Simply unpack and run mb from inside |
|
OS-specific packages | No | Yes | Puts mb at /usr/local/bin , which is generally in the PATH . |
|
source tarball | Yes | No | source tarball if you roll that way. |
*mountebank wishes very much for your Windows experience to be hassle-free, but he is simply not qualified to address a particular constraint of Windows Explorer. For legacy reasons, some Windows applications, including most notably Windows Explorer, have a maximum number of characters allowed in a path of 260 characters. As mountebank writes these words, the longest path he includes in the zip files is around 175 characters. The zip file name, which is likely to represent itself as two nested directories if you use the defaults to unzip it, will be around 25 characters. That gives you very little wiggle room. If you unzip the file in your users directory, you may very likely get an error because of this constraint.
The following solutions will all work:
npm
to install mountebank instead of the zip file