Cloud Foundy Services Connector (Node.js) 介绍
这个库提供了一个代理的实现,用来开发在 Cloud Foundry
基础平台上的任何定制服务。
示例代码:
Broker = require 'cf-services-connector' config = require 'config/custom-service' # JSON config file broker = new Broker(config) broker.start (err) -> broker.log.error(err) broker.on 'error', (err) -> broker.log.error(err) broker.on 'provision', (req, next) -> # Do custom provisioning action / generate credentials # The API allows 'dashboard_url' to be returned here, i.e.: # next({dashboard_url: "http://example/instance1" }) next(); broker.on 'unprovision', (req, next) -> # Delete service instance # req.params.id next() broker.on 'bind', (req, next) -> # Take any action for binding reply = credentials = host: '192.168.100.200' port: 9999 user: 'demo' pass: 'demo' next(credentials) broker.on 'unbind', (service, cb) -> # Undo instance binding # here we tell the CC this instance does not exist reply = doesNotExist: true next(reply)
Cloud Foundy Services Connector (Node.js) 官网
https://github.com/ActiveState/cf-services-connector-nodejs
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。