hapijs / glue

Server composer for hapi.js
Other
245 stars 62 forks source link

Manifest doesn't allow for other plugin options #51

Closed rjmreis closed 8 years ago

rjmreis commented 8 years ago

Not sure I'm doing everything right here, but while upgrading to v3 it seems I can't have other plugin options other than select. This is an example of what I'm trying to load:

{
  "connections": [
    {
      "port": 8080,
      "labels": ["http"]
    }
  ],
  "registrations": [
    {
      "plugin": "vision",
      "options": {
        "select": "http"
      }
    },
    {
      "plugin": "visionary",
      "options": {
        "select": "http",
        "engines": {
          "html": "handlebars"
        },
        "path": "/views"
      }
    }
  ]
}
rjmreis commented 8 years ago

It appears that the following syntax works. Hopefully this will help someone.

{
  "plugin": {
    "register": "visionary",
    "options": {
      "select": "http",
      "engines": {
        "html": "handlebars"
      },
      "path": "/views"
    }
  }
}
gergoerdosi commented 8 years ago

@rjmreis: I doubt it works, select should not be in plugin.options. In your case select was probably ignored and visionary was registered to all connections. I made an attempt to fix this in #49.

rjmreis commented 8 years ago

You're right @gergoerdosi, had to move it out of the plugin object. This worked:

{
  "plugin": {
    "register": "visionary",
    "options": {
      "engines": {
        "html": "handlebars"
      },
      "path": "views"
    }
  },
  "options": {
    "select": ["http"]
  }
}
lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.