1.0.1 • Published 7 months ago

@raprincis/service-broker v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Service Broker

Initialize a Service broker

const broker = Broker.create({
  // This must correspond to the credential when createing the OSB in CF
  withAuthentication: 'Basic someauthentication', 
  services: [new OsbService({
    id: 'fbb89e27-8b39-4aa4-b00a-415326185ea9',
    name: 'date-utilities',
    description: "Date",
    instances_retrievable: true,
    bindable: true,
    plans: [{
      id: 'd226e953-dcd6-4bf8-aa63-12ba196b7fb1',
      name: 'free-plan',
      description: 'A free plan',
      free: true
    }]
  })]
})

const PORT = Number(process.env.PORT || '3000')
const app = express()

app
  .use('/broker', broker.handler)
  .listen(PORT)

Intercept call

For this case, extends the class OsbService

class DateService extends OsbService {
  
  // Handle Provision request
  provision(request: ProvisionRequest<CreateProvisioning<Record<string, any>>>): Provision {
    return {
      dashboard_url : 'http://localhost:3000/dashboard'
    }
  }
}


const dateService = new DateService({ /** Your configuration here */})
1.0.1

7 months ago

1.0.0

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago