- You can now submit
DELETE /
to the admin endpoint to delete all configured stubbed endpoints (#89)
- BREAKING CHANGES from 4.x
- The exit code for the
stubby
bin script will reflect the expected/error state of stubby.
- The exit code for the
- Dependencies have been updated to prevent vulnerabilities.
acorn
updated from 7.0.0 to 7.1.1- updated node versions for testing
- lodash updated from 4.17.15 to 4.17.19
- Updates depenencies with reported vulnerabilities
- Adds support for POST forms as a hashmap
This project has been stable for some time, best we move to actual semver and
not prerelease versioning. This release on the old versioning system would have been release 0.4.0
. It is now 4.0.0
instead.
-
BREAKING CHANGES from 0.3.x
- The
mute
option has been renamedquiet
to be more consistent with other cli tools
- The
-
New features
- Adds
hits
to the endpoint data that is returned from the admin portal that represents the amount of times that endpoint has been hit from the stubs portal.
- Adds
- Fixes
path
errors in Node 6
- BREAKING CHANGES from 0.2.x
- In
0.2.x
and below, you could passrequest.headers.authorization
as ausername:password
string to signify Basic auth and stubby would automatically prefixBasic
and base64-encode the user/pass string. This breaks other forms of web auth that uses theAuthorization
header.
Stubby will still base64-encode the# Before request: headers: authorization: 'username:password' # Now request: headers: authorization: 'Basic username:password'
username:password
if it sees thatBasic
is specified and the:
character is present. Otherwise it will take it as-is. - In
- New features
json:
option for endpoints -- instead of usingpost:
orfile:
for matching the body of incoming requests, you can specifyjson:
with a JSON string and its content will be deeply matched for incoming request bodies.
- fixes a crash when using
start()
without any options
- fixes array representations in query strings
- fixes several scope-binding issues caused by the JavaScript rewrite (sorry!)
- clarify use of
PUT
and the admin portal - added
_httpsOptions
to pass through options to the underlying tls server.
- fix colorsafe console wrapper errors (Esco Obong)
- Rewrote library in JavaScript (was CoffeeScript)
- fixes the status page display (Hadi Michael)
- fixes unhelpful output when the location given cannot be bound to
- fixes an issue where identical URLs with different request methods may throw an exception
- token replacement from regex capture groups is now usable for dynamic
file:
usage
- added recording feature. If a
response
object uses a string in place of an object (or a sequence of objects/string) the strings will be interpreted as a url to record the response from. Details configured in therequest
object (such asmethod
,headers
, etc) will be used to make the recording request to the specified url - improved CORS compliance with request/response headers
- added dynamic templating features for interpolating data captured in request regular expressions into response strings
- CORS compliance as per W3C specifications. Using
*
as the--location
will instruct stubby to listen on all interfaces. Implemented by Tomás Aparicio
- bugfix for "Could not render headers to client" from
h2non
- added cyclic responses.
response
can now be a yaml sequence of responses. Backward compatible, thus the minor version bump - all string values for
response
criteria are matched as regular expressions against the incoming request
- bugfix: admin and programmatic APIs correctly parse incoming data
- updating styling of status page.
- fixed a bug with the latest version of node where status page was no longer showing.
- urls are now matched via regular expressions. If you want an exact match, remember to prefix your urls with
^
and postfix with$
- binary data files are working correctly when used as a response body
- fixed a bug were stubby's version number was appearing as
undefined
in theServer
header
- fixed a bug involving recursive use of
process.nextTick
- line endings are normalized to
\n
and trailing whitespace is trimmed from the end when matching request's post/file contents
response.file
andrequest.file
are now relative paths from the root data.yaml instead of being relative from the source of execution
request.headers.authorization
can now take values such asusername:password
which will automatically be converted toBasic dXNlcm5hbWU6cGFzc3dvcmQ=
.- parameterized flags can now be combined with non-parameterized flags. Example:
-dw data.yaml
is equivalent to--watch --data data.yaml
. - switched from handlebars to underscore for client-side templating
- added
PATCH
to acceptable HTTP verbs. - bugfix where
--watch
flag was always active. - added
man
page support
- bugfixes related to command line parsing
- fixed bug where query params were not being saved
- added
status
endpoint on admin portal.
- main
stubby
module now correctly accepts all options availabel via the command line in it's first argument. - added
-w, --watch
flag. Monitors the supplied-d, --data
file for changes and reloads the file if necessary. - for the
require('stubby')
module, a filename is passed asoptions.watch
for thestart(options, callback)
function.
- made method definitions (
PUT
,POST
, etc.) case insensitive. You could usepost
,get
, etc. instead. - made
response
object completely optional. Defaults to200
status with an emptybody
. - you can now specify an array of acceptible
method
s in your YAML:
- request:
url: /anything
method: [get, head]
- added /ping endpoint to admin portal
- running stubs portal at both http and https by default
- addition of
-t, --tls
option to specifying https port for stubs portal
- added
file
parameter torequest
object. When matching a request, if it hasfile
specified it will load it's contents from the filesystem as thepost
value. If thefile
cannot be found, it falls back topost
.
- added
query
parameter forrequest
objects to allow comparison by variable instead of static querystring
- fixed severe issue where request headers were not being matched by the stubs portal
- renamed "stub" option to "stubs"
- NEW:
request.file
can be used to specify a file whose contents will be used as the response body. If the file cannot be found, it falls back to whatever was specified inresponse.body
- stubby can now be muted
- removed coffee-script as a dependency
- errors and warnings for missing or unparsable data files have been improved
- re-write of code operating the command-line interface
- admin portal console logging for responses
- reworked API contract failures for admin portal. Upon BAD REQUEST server returns an array of errors describing the endpoint validations that were violated.
- logging messages fixes for stub portal
- fixed callback parameters for stubby interface
- you can now make as many instances of stubby as you want by: require("stubby").Stubby and var stubby = new Stubby()
- callbacks now give copies of endoints instead of refernces. This prevents unexpected changes to endpoints outside of stubby
- bug fixes. optional dependency js-yaml is now really optional
- serval bugs fixed that were found while experimenting with a main module
- fixed but with endpoints with undefined headers not being accepted
- added -k, --key and -c, --cert and -p, -pfx options for stating stubby as an https server
- retired -f, --file option in lieu of -d, --data to prevent confusion between suppling files for data files versus ssl key/certificate files
- added -l flag for starting stubby at a particular address
- added -v --version command line option
- gracefully exits on error when starting stubby
- removed node-inspector as a dependency
- removed jasmine-node as a dependency
- default stub portal is now 8882 (from 80)
- default admin portal is now 8889 (from 81)
- initial release