Skip to content

Is there a standard for middleware libraries? #3150

Description

@franciscop

I know how to create/use middleware and I'm aware of Writing middleware for use in Express apps, however I am curious about packaging/publishing middleware.

Many of the express middleware seems to be following this convention:

let middle = require('middleware-name');
let options = {};

app.use(middle(options));

I have used the same for a couple of projects of mine since it seems really useful way of including the options, but haven't seen it anywhere as a recommended way of doing it. Is this part of some standard/recommended way of creating middleware? Should I edit that guide to reflect this as the recommended way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions