@r35007/mock-server
Advanced tools
Changelog
v16.0.0
.cjs
file extension. When package.json has a type module
then provide a .cjs
file extension path to require a javascript file.dbMode: "config"
. If dbMode is config
then it expects always a config object to a route and setting _config: true
is an optional attribute when dbMode is in config
.
config
then in db.json
const db = {
'/user': { mock: { id: 1, user: 'foo' } }, // -> "/user": { _config: true, "mock": { "id": 1, "user": "foo" } }
'/users': [
{ id: 1, user: 'foo' },
{ id: 2, user: 'bar' },
], // -> "/user": { _config: true, "mock": { } }.
'/auth': (req, res, next) => {
next();
}, // -> This route directly uses the middleware without any helper middleware wrappers.
};
Edit
, Refresh
, Reset
etc.. Action buttons for a direct use route in a Home Page.Page not found
issue resolved.Changelog
v15.0.0
1.3.2
.noCache
in Mock Server CLI options.locals.statusCode
- Directly set any statuscode to locals using middleware.locals.headers
- Directly set any response headers to locals using middleware.Headers
, Fetch Headers
, Fetch StatusCode
in Mock Server Homepage.Changelog
v14.1.0
Transfer-Encoding
: chunked
in response headers._IterateResponse
middleware not working issue fixed.Ctrl+Click
or Cmd+Click
the link in home page will open the link in new tab.noCache
option to config. Default to true
. Set to false
to enable cache./:id
params will to added to route if the the route has a _AdvancedSearch
or _CrudOperation
middleware and don't have ends with a param.Changelog
v14.0.1
setConfig
not merging new config with existing config object if merge option is set to true issue fixedmockServer.defaults
not merging new config with existing config object issue fixedChangelog
v14.0.0
homePage
in config. Set to false to disable Mock Server Homepage.quiet
flag is set to true.