BlueOakJS / blueoak-server

express.js-based, swagger-matic, server runtime
MIT License
141 stars 25 forks source link

Update server-provision config to allow loading subset of services/middleware #89

Open jwsm opened 7 years ago

jwsm commented 7 years ago

We're proposing a backwards-compatible enhancement to the "server-provisions" feature/config block introduced in https://github.com/BlueOakJS/blueoak-server/pull/87.

In some cases, a container BOS may wish to only include some subset of services or middleware from a provisioned BOS rather than all. In addition, to avoid naming conflicts you would want to be able to give the provisioned service a mapped name.

In the example below:

"server-provisions": [{
  "package": "sfi-esb",
  "services": [
    "femaService",
    "emailService": {
      "mappedName": "myEmailService"
    }
  ],
  "middleware": [
    ...
  ]
}],
seanpk commented 7 years ago

This looks really useful, and provides a solution to one of the concerns that we had with the first implementation: conflicting service and middleware names.

I'd like to suggest a change to the "extended" format, either: "as" instead of "mappedName" or "myEmailService:emailService"

jwsm commented 7 years ago

Thanks. I will work on an implementation.