-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create an API documentation page based on the files #16
Comments
Hello. My name is Sergei. I have an idea about issue#16. |
Hi Sergei, I really like the idea, I just scrolled through the code real quick and it looks like a good approach really. One thing I would love to have so would be the option to turn it off, so the idea would be to make it more like a plugin you activate instead of having it always available. Maybe we can define a hook to hook into the canned method to inject stuff like this before we route to canned this would open it up for more processing since I think their will be some parts you want to filter out of the docs for example. It is a great start and thanks for taking this on! For reference the pull request is #38 |
I define some like router in canned.js. But file "swagger.js" is like a plug-in. |
That sounds like a good idea, so I would suggest moving the swagger.js file to a extensions folder, and make its loading configurable maybe passing something like this on the command line
and then instantiate swagger with the setFolder and setApiUrl and such so it can be passed.
The reason for all this really is that love the concept of doing this with swagger but I also see that a lot of people don't want to use swagger so keeping it configurable seems like a good way to go for now. What do you think about that? |
I try to realize it tomorrow. Another version
And JS includes.forEach(function(include){
fs.stat(include.name, function(stat){
if(!stat.isDirectory())
return fasle
var extension = require('./extensions/'+include.name+'/main.js')
new extension(include.options && JSON.parse(include.options))
})
});
} Or something like this. And it would be nice to add extensions to express chain. |
Please see 4a82e08 |
Try
|
There has been work going on to use express in #33 and the branch express-canned but looking over this I'm not sure if the dependency to express adds that much. As far as I can see you use express to have the support for middleware can't you achieve the same with just using async.waterfall? I don't mind the dependency to express if necessary but since it is quite a big dependency canned needs to track changes etc. I want to be sure we really need it. |
(lets move the discussion to the pull request so I can comment on code :) ) |
I add "async" variant. |
Scanning through the directory to explore the API is nice but it would be great if it would be possible to output a simple HTML page which just lists the available endpoints with their requests.
Something like seen in the readme for showing what canned can do.
The text was updated successfully, but these errors were encountered: