Plugins are a way of extending the functionality of Mocks Server.
Some things that can be made with a plugin are:
- Listen to Mocks Server events and act in consequence.
- Add custom express routers to the server.
- Add new options, accessible even through command line arguments.
- Change settings while the server is running.
- Add new formats of defining
route variants. (Using custom routes handlers)
Use the configuration file for installing plugins:
Note the usage of the
addPlugins property, not the
plugins one. This is because the main distribution of Mocks Server (@mocks-server/main) already includes some plugins to improve the user experience. If you use
plugins instead of
addPlugins, all other plugins would be removed.
Use the "mocks-server-plugin" tag to search Mocks Server plugins in NPM.