Skip to content

Set per-plugin registration options when registering an array of plugins #1850

@martinheidegger

Description

@martinheidegger

When I want to set the options and a path prefix for a plugin it looks like this:

server.pack.register({
    plugin: require("my-plugin"),
    options: {
       foo: "bar"
    }
}, {
    route: {
        prefix: "/myprefix"
    }
}, function () {
    ... 
});

It looks like the object containing the route definition seems unnecessary clutter. Would it be possible to offer setting the route in the plugin definition? Somehow like:

server.pack.register({
    plugin: require("my-plugin"),
    options: {
       foo: "bar"
    },
    route: {
        prefix: "/myprefix"
    }
}, function () {
    ... 
});

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions