Skip to content

Cannot skip route with middleware #334

Open
@srosset81

Description

@srosset81

Hello,

On the index.d.ts file, it is noted we should be able to call Express-style next('route') in a middleware to skip to another route:

moleculer-web/index.d.ts

Lines 393 to 405 in 29637c1

interface NextFunction {
(err?: any): void;
/**
* "Break-out" of a router by calling {next('router')};
* @see https://expressjs.com/en/guide/using-middleware.html#middleware.router
*/
(deferToNext: "router"): void;
/**
* "Break-out" of a route by calling {next('route')};
* @see https://expressjs.com/en/guide/using-middleware.html#middleware.application
*/
(deferToNext: "route"): void;
}

But when I do that, an error is simply thrown with "route" as the message (Request error! MoleculerError : route).

Would it be possibly to add this option ?

Many thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions