How to setup/use Swagger on local Windows machine

How to setup/use Swagger on local Windows machine

  1. Download Node.js from the website below and set it up locally. (Because Swagger is written by Node.js, we need to setup Node.js environment to run it.)
    http://nodejs.cn/download/
  2. (Optional) Open a command line window, run the following command to make sure Node.js is installed successfully:
    node -v
  3. Run the following command to install necessary tools, such as python2.7, vc++ and .netFramework4.5, if you do not install them, then the process of installing Swagger may fail with message like this: “Error: Can’t find Python executable “python”, you can set the PYTHON env variable.”
    npm install --global --production windows-build-tools
  4. Go to Swagger editor page on github to download the latest Swagger code. Click “Clone or downlaod” -> Download ZIP
    https://github.com/swagger-api/swagger-editor.git
    在这里插入图片描述
  5. Unzip the package you just downloaded and put it to a directory, such as: C:\swagger-editor-master
  6. In command line window, navigate to C:\swagger-editor-master, then run the command below to install Swagger and dependencies. (It may take a long time to finish, ignore those warnings)
    npm install --no-optional
  7. In command line window, navigate to C:\swagger-editor-master, then run the command below to run the http server of Swagger
    npm start
  8. You may see the following info on console, which indicates you to visit http server.
    Starting up http-server, serving ./
    Available on:
    http://x.x.x.x:3001
    http://127.0.0.1:3001
  9. In the command line window, press “Ctrl + c” to stop server. If you want to start the server again, run command “npm start” in C:\swagger-editor-master folder.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值