Swagger Sails JS

后端 未结 5 793
执念已碎
执念已碎 2020-12-08 11:04

Any idea of how to integrate swagger, swagger-ui with a sails js project?

Where can i found information about it, or about another

5条回答
  •  無奈伤痛
    2020-12-08 12:03

    Install

    $ npm install sails-swagger --save
    

    Configuration

        // config/swagger.js
    module.exports.swagger = {
      /**
       * require() the package.json file for your Sails app.
       */
      pkg: require('../package'),
      ui: {
        url: 'http://swagger.balderdash.io'
      }
    };
    

    After installing and configuring swagger, you can find the docs output on the /swagger/doc route.

提交回复
热议问题