:(master) ? >node index.js
Open Browser, enter http://localhost:3000/static/index.html
So far, you've already configured the official demo locally. Of course, you can do it. This is built on the server.
Writing Documents and publishing
Writing API documentation using Swagger Editor
Swagger Editor is a YAML-based syntax, but don't be afraid to watch the official de
.startup.cs=>configure// Document parsing app. Useswagger (); App. Useswaggerui ();3. Description information of the automatic Read methodReference Document: Https://docs.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swaggerFocus: How to customize the Swagger UIAfter all the configuration has been done, direct access to the HTTP://XXX/SWAGGER/
-server can open the input and then access port 8080 on this server.
Installation of Swagger-ui
Displays the API documentation generated by the Swagger-editor, which can be in YAML or JSON format.
Installation steps:
Download Swagger-ui git addre
reason why I choose to use swagger, direct official said restful style that do not pipe, not restful style interface can also be used, of course, swagger also have a way is manual write interface, the advantage is that code only code, Because once the code added swagger interface annotation, the amount of code has increased a lot, of course, the disadvantage is
OverviewThis post is a complete story of what if you define and start a GRPC service through protocol buffers, and then provide a reverse proxy gateway for the RESTful JSON API on the GRPC service, and finally provide restful through the swagger UI Description of the JSON API, complete code helloworld_restful_swagger.Helloworld Grpc ServiceRefer to Grpc Quick Start for Python.Install GRPC installation GrpcR
As a background developer, always avoid to the app to write API interface documents, previously used HTML5 and Css3+jqury to write dynamic pages, but each time the change is cumbersome, and it is possible to change the code forgot to modify the document, so on the Internet to find some information, found swagger UI This framework everyone is more recommended, now record the setting of the environment.The
Introduction:Swagger-ui is a great Web API description help page, specific details can be Google and Baidu.Official website: Http://swagger.io/GitHub Address: Https://github.com/swagger-api/swagger-uiUse:Swagger-ui is a pure front-end language development of the project, all the powerful functions by JS implementation.
/ui}
Finally, when testing the dynamic Web Api service from the Swagger UI, to send the CSRF Token, you need to add the Swagger UI index.html file to your project, which should be placed in the"Wwwroot \ swagger \
Swagger 2.0 document, and other functions. Swagger-core: The Swagger implementation for Java/scala . With Jax-rs (Jersey,resteasy,CXF ...) , The Servlets and Play Framework are integrated. Swagger-js: The Swagger implementation for JavaScript .
Use the Swagger-UI open source component (a deep-seated solution) in Web APIs, and use the APIIntroduction:
Swagger-Ui is a great help page for Web API instructions. For details, Google and Baidu.
Official Website: http://swagger.io/GitHub address: https://github.com/swagger
Swagger-docs:Https://github.com/richhollis/swagger-docsSwagger-docs-sample:https://github.com/richhollis/swagger-docs-sample/blob/master/readme.mdSwagger-ui:https://github.com/wordnik/swagger-ui1. Vim Gemfile Addgem ‘swagger-docs‘ 然后bundle 或者直接gem installSwagger-docs2、cd rai
WebApi uses swagger ui to automatically generate interface documents.
I wrote it earlier. Webapi is being used recently. Here is a practical example of swageer ui.Currently, both the frontend and backend are developed separately. Here we provide APIs for the front-end. Sometimes you do not want to write a document specifically for the description of an api. It is a waste of time.The
use it to invoke any authorized operation. all Services can be used remotely. For example, we can use User Services to get a list of users :we sent a GET request to HTTP. localhost:62114/api/services/app/user/getusers and added the title as "
Bearer ". returns the JSON containing list of users. SWAGGER UIThe SWAGGER UI is integrated into ASP. NET
The swagger UI can be used to intercept the controller layer, generate the request API, and display it in the browser. We can view and debug interfaces directly from the browser.1 adding Maven Dependencies Swagger - Dependency> groupId>Io.springfoxgroupId> Artifactid>Springfox-swagger
recognized. ② maintenance difficult, not easy to find. ③ front-end development cannot be tested. (If you want to write the shortcomings, there are 5k+ words can be written out, then omitted ha)
When I developed the backend of the second app, I wrote a simple app interface management system for the backend publishing interface, as well as the front-end staff to view. EffectPS: Advantages: ① If you have multiple front-end personnel, you can ensure that you see the same document. ② through the
Problem Description:When we test the Web API with the Swagger UI times 401 ErrorLet's open the Get/api/services/app/role/getall, enter the parameters.Click the Try it out! button to report 401 errorsCauses and SolutionsSee an icon with a red exclamation mark in the upper-right cornerClick to view the reason is that the Access API needs to enter the authorization token value for verification, token value is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.