Migration from v3 to v4
Expresser has its core principles changed on v4. Up to v3, it adopted a "do-it-all" and "try-it-all" approach. It was bloated. On v4, which was built almost from the ground up, it includes only the very essential feature set which should be required by any standard Express application, be it a REST API or a full-fledged website.
It also drops lots of assumptions about what the developer wants to do. Now, for the most part, if something fails an exception is thrown and the developer can decide what to do and how to proceed.
The easiest way to migrate v3 apps to v4 is by using the
$ npm install expresser-legacy
And then to setup:
let expresser = require("expresser") let expresserLegacy = require("expresser-legacy") expresserLegacy.init(expresser, true)
The second parameter,
useDefaultSettings, is set to true above, meaning it will load all default settings from the legacy modules and plugins. If you have loaded all the required settings prior to calling the
init() method, you can pass it as false, so:
The following plugins from v3 are fully supported when using expresser-legacy:
Other plugins had very little usage (data from NPM and GitHub) so no guarantees that they will work.
Getting rid of legacy code
Some of the features previously available in Expresser were decoupled and are now separate modules: