简体   繁体   中英

Customizing the Hyperledger Composer Rest Server

I have a test Hyperledger Fabric running in the IBM Cloud, with the IBM Blockchain Application Service. I also have a kubernetes cluster running the Hyperledger Composer REST Server. Everything works great, but how do I extend the REST api with some custom api's? The documentation mentions being able to use the swagger definition (yaml file) with the IBM API Connect or Strongloop product...but how do I do that, as I don't see any way to export the swagger definition?

I don't have a tutorial, but as I see it you would have to do three tasks minimally:

  1. write your REST APIs (to do what you want to do) - perhaps these resources on REST APIs will help ? -> Loopback -> https://developer.ibm.com/code/patterns/create-rest-apis-using-loopback/ and in architectural in general -> https://www.ibm.com/developerworks/library/ws-restful/ and
  2. build the routes for your custom APIs

  3. customise your swagger definitions to document your REST APIs - this may help you -> https://www.ibm.com/developerworks/library/wa-use-swagger-to-document-and-define-restful-apis/index.html and Swagger itself -> http://swagger.io/

If you write custom api and call it as 3rd party api which is mentioned in IBM already it will help you to response but it has very limted scope. I belive you should use swagger to understand its end point are properly configured

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM