阅读量:2
以下是在Ubuntu上安装Swagger UI的几种方法:
- 方法一:使用npm安装
- 安装Node.js和npm:
sudo apt update,sudo apt install -y nodejs npm。 - 全局安装Swagger UI:
sudo npm install -g swagger-ui。 - 下载并解压Swagger UI:
wget https://github.com/swagger-api/swagger-ui/archive/refs/tags/v3.48.0.tar.gz,tar -xvf v3.48.0.tar.gz。 - 启动Swagger UI:
cd swagger-ui-3.48.0,npm install,node index.js,访问http://localhost:3000。
- 安装Node.js和npm:
- 方法二:从GitHub克隆并运行
- 安装Node.js和npm(同上)。
- 克隆Swagger UI仓库:
git clone https://github.com/swagger-api/swagger-ui.git。 - 进入目录并安装依赖:
cd swagger-ui,npm install。 - 启动Swagger UI:
npm start,访问http://localhost:3000/swagger-ui/index.html。
以上就是关于“Swagger UI在Ubuntu上如何安装”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm