背景
网上有很多通过node、npm、安装http-server的方式进行启动,不过这些需要网络畅通的情况下进行,不具备上述条件可以通过Tomcat来启动。下面通过在笔记本上启动的方式简单记录下,通过该方法已经成功在centos上部署并且使用。
一、环境准备
apache-tomcat-8.5.56
gitee:
swagger editor: https://gitee.com/mirrors/swagger-editor.git
swagger ui: https://gitee.com/mirrors/swagger-ui.git
由于从git上下载比较慢,可以通过gitee来下载
二、启动Tomcat前的准备
将swagger editor和swagger ui下载下来。
参考 【https://www.cnblogs.com/rmxd/p/11419193.html】,该文档中介绍了三种Tomcat部署的方式,结合实际情况,我选择了,在 apache-tomcat-8.5.56\conf\Catalina\localhost 路径下添加 项目xml的方式进行部署
swaggerEditor.xml内容
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="F:\workspace\practice\swagger_editor\swagger-editor" reloadable="false" />
swaggerUI.xml内容
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="F:\workspace\practice\swagger-ui\swagger-ui\dist" reloadable="false" />
win中通过bin/startup.bat启动项目
三、启动成功
http://localhost:8080/swaggerEditor/
http://localhost:8080/swaggerUI/