I am new to Redoc. We are planning to use Redoc for private API specs. We have more than 100 API specifications.
As far as i understand, if we have private APIs then we have to use Redoc-cli only.
I am having issue to deploy All APIs on single sever.
Can you please guide me, how can i deploy all 100 API specifications into one server with ReDocs-CLI?
As far as i understand, if we have private APIs then we have to use Redoc-cli only.
I don't really see any limitation like that, how did you come to this conclusion?
Can you please guide me, how can i deploy all 100 API specifications into one server with ReDocs-CLI?
Speaking about such a number I really would use some automation script to manage the deployment for you.
One possibility, that i wouldn't recommend, would be to run 100 instances of redoc-cli serve with different port ( -p) and then manage the access thought reverse proxy settings in your server of choice ( nginx for example ).
But with such a huge number of specifications this is not optimal, bundeling each of your spec with redoc-cli bundle deploying the bundled result somewhere ( /var/www/apis/spec1, /var/www/apis/spec2... ) on the server with rsync for example and then serving it again with a web server would be a far better option.
Again i would advice you to take a look into tools like ansible or shipit for automating the process for some extense, also combining those with automation tools like travis or gitlab-runner would be a good fit.
if you are creating micro-services and thereby ending up creating multiple open-api specs. But still want to have a one centralize document to browse, then checkout this question https://softwarerecs.stackexchange.com/questions/64956/free-options-for-viewing-hosting-multiple-swagger-openapi-files
@nanov - Thanks a lot for your quick reply. Sorry for late reply because i was working on your suggestion.
I don't really see any limitation like that, how did you come to this conclusion?
>
I came on this conclusion, because we can specify Local Swagger file from "redoc-cli" only.
Is there anyway to specify local api specs on redoc server directly? If yes, could you please guide me, how can i do that?
I got below options to specify URL but i didn't find a way to specify local API specs.
<redoc spec-url='http://petstore.swagger.io/v2/swagger.json'></redoc>
docker run -p 8080:80 -e SPEC_URL=https://api.example.com/openapi.json redocly/redoc
We are mostly going to adapt your suggestion to generate multiple HTML files and host with WebServer.
I got below options to specify URL but i didn't find a way to specify local API specs.
It makes no sense to specify local specs as this is done on client side, you can configure your server to serve those specifications and then put them there, it is anyways a good idea to do so, so users can download your specification and use it for their needs.
I got below options to specify URL but i didn't find a way to specify local API specs.
It makes no sense to specify local specs as this is done on client side, you can configure your server to serve those specifications and then put them there, it is anyways a good idea to do so, so users can download your specification and use it for their needs.
But for this we need to host other server for API Specification. If we will go ahead with this approach then we need to host two Web Server, one for API specification and another for Redoc Server. Our API specification stored in Microsoft GIT server, so we shouldn't duplicate storage.
i think Second approach is better, where we need to host only Server.
got below options to specify URL but i didn't find a way to specify local API specs.
It makes no sense to specify local specs as this is done on client side, you can configure your server to serve those specifications and then put them there, it is anyways a good idea to do so, so users can download your specification and use it for their needs.
But for this we need to host other server for API Specification. If we will go ahead with this approach then we need to host two Web Server, one for API specification and another for Redoc Server. Our API specification stored in Microsoft GIT server, so we shouldn't duplicate storage.
i think Second approach is better, where we need to host only Server.
Don't really get your point, butt we are sliding into DevOps talk here. Basically you need one server serving static files.
Most helpful comment
I don't really see any limitation like that, how did you come to this conclusion?
Speaking about such a number I really would use some automation script to manage the deployment for you.
One possibility, that i wouldn't recommend, would be to run 100 instances of
redoc-cli servewith different port (-p) and then manage the access thought reverse proxy settings in your server of choice ( nginx for example ).But with such a huge number of specifications this is not optimal, bundeling each of your spec with
redoc-cli bundledeploying the bundled result somewhere (/var/www/apis/spec1,/var/www/apis/spec2... ) on the server withrsyncfor example and then serving it again with a web server would be a far better option.Again i would advice you to take a look into tools like ansible or shipit for automating the process for some extense, also combining those with automation tools like travis or gitlab-runner would be a good fit.