Skip to content

raprins/service-broker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 */})

About

Service Broker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages