Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sails.js API documentation

I want to develop an API using the MVC pattern. I found sails framework interesting and I'd like to know if it's possible to configure swagger or something like with sails to generate the documentation of my API (something like swagger-express for express for example).

Thanks!

like image 641
krakig Avatar asked Mar 03 '15 14:03

krakig


2 Answers

This feature is in progress. If you'd like to help out, we can all collaborate here: https://github.com/balderdashy/sails/issues/1094

Update (August 2015):

Check out this Sails Hook that offers native Swagger integration. It compiles all of the bound routes in Sails, and generates a Swagger 2.0 document: https://github.com/tjwebb/sails-swagger

like image 156
Travis Webb Avatar answered Oct 20 '22 23:10

Travis Webb


Here is what I did to have my documentation work with sails.js : you can download swagger-ui here : https://github.com/swagger-api/swagger-ui or via npm (npm install swagger-ui).

Then in the assets folder of your sails project, create a folder that points to the swagger folder ("docs" for example, so you'll be able to access to your documentation via your_url:port/docs)

like image 38
krakig Avatar answered Oct 20 '22 22:10

krakig