UNPKG

@admin-bro/express

Version:

This is an official AdminBro plugin which integrates it to expressjs framework

32 lines (29 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OldBodyParserUsedError = exports.WrongArgumentError = void 0; class WrongArgumentError extends Error { constructor(message) { super(message); this.name = "WrongArgumentError"; } } exports.WrongArgumentError = WrongArgumentError; class OldBodyParserUsedError extends Error { constructor(message = ` You probably used old \`body-parser\` middleware, which is not compatible with @admin-bro/express. In order to make it work you will have to 1. move body-parser invocation after the admin bro setup like this: const adminBro = new AdminBro() const router = new buildRouter(adminBro) app.use(adminBro.options.rootPath, router) // body parser goes after the AdminBro router app.use(bodyParser()) 2. Upgrade body-parser to the latest version and use it like this: app.use(bodyParser.json()) `) { super(message); this.name = "WrongArgumentError"; } } exports.OldBodyParserUsedError = OldBodyParserUsedError; //# sourceMappingURL=errors.js.map