swagger editor(一)

https://github.com/jiaxiaolei/swagger-editor.git
简介:
swagger 在github 上有仓库。这里是我fork的一个地址。

使用实例:

  • 基础环境
$ node -v
v6.11.1

$ npm -v
3.10.10

$ cnpm -v
[email protected] (/usr/lib/node_modules/cnpm/lib/parse_argv.js)
[email protected] (/usr/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
[email protected] (/usr/bin/node)
[email protected] (/usr/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr
linux x64 3.10.0-514.26.2.el7.x86_64
registry=http://registry.npm.taobao.org
  • fork 一份 swagger 的代码(https://github.com/swagger-api/swagger-editor), 得到https://github.com/jiaxiaolei/swagger-editor.

  • clone 一份代码:
    $ git clone https://github.com/jiaxiaolei/swagger-editor

  • 安装依赖包:

$ cd swagger-editor
$ cnpm install 

NOTE: 用原生的npm 安装,一大堆依赖失败。用cnpm安装成功。

  • 启动项目
$ npm start

> [email protected] prestart /root/software/swagger-editor
> npm install

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of eslint@>=3.8.1 but none was installed.
npm WARN [email protected] requires a peer of eslint@>=3.0.0 but none was installed.
npm WARN [email protected] requires a peer of eslint@>=3.0.0 but none was installed.
npm WARN [email protected] requires a peer of react@^0.14.8 but none was installed.
npm WARN [email protected] requires a peer of react@^0.14.0 but none was installed.
npm WARN [email protected] requires a peer of webpack@^2.2.0 but none was installed.

> [email protected] start /root/software/swagger-editor
> npm-run-all --parallel serve-static open-static


> [email protected] serve-static /root/software/swagger-editor
> http-server -i -a 0.0.0.0 -p 3001


> [email protected] open-static /root/software/swagger-editor
> node -e 'require("open")("http://localhost:3001")'

Starting up http-server, serving ./
Available on:
  http://127.0.0.1:3001
  http://172.28.32.51:3001
  http://172.28.32.57:3001
Hit CTRL-C to stop the server

swagger editor(一)_第1张图片
image.png

扩展阅读:

Swagger
http://www.jianshu.com/p/4115f2b53983
简介:

swagger学习

Swagger定义
Swagger同类工具
Swagger和web项目结合
Swagger在公司项目中如何应用

提供了很多学习资料。

Swagger入门教程
http://www.cnblogs.com/JoiT/p/6378086.html
简介:

提到了很多Swagger 的实现例子。

你可能感兴趣的:(swagger editor(一))