AsyncAPI 类似openapi 也提供了一些周边工具
editor
类似openapi 的,但是目前官方已经不推荐使用了,推荐使用playground,以下是构建一个容器镜像
- clone 代码
git clone https://github.com/asyncapi/editor.git
- 修改dockerfile
默认的制作出来的镜像太大了
FROM node:9-alpine
?
RUN npm config set registry https://registry.npm.taobao.org
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# set default node environment
ENV NODE_ENV development
?
COPY . /usr/src/app
?
# Install app dependencies
RUN npm install
?
EXPOSE 5000
?
CMD [ "npm", "start" ]
- 使用docker-compose 管理
version: "3"
services:
editor:
build: ./
image: dalongrong/asyncapi-editor:1.0.1
ports:
- "5000:5000"
- 构建&&启动
docker-compose build && docker-compose up -d
- 效果
- 说明
镜像已经push dockerhub 了dalongrong/asyncapi-editor:1.0.1
playground
同上以下是镜像构建的过程
- clone 代码
git clone https://github.com/asyncapi/playground.git
- 修改dockerfile
FROM node:9-alpine
?
RUN npm config set registry https://registry.npm.taobao.org
?
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# set default node environment
ENV NODE_ENV development
?
COPY . /usr/src/app
?
# Install app dependencies
RUN npm install
?
EXPOSE 5000
?
RUN npm install -g forever
?
CMD forever -c "npm start" ./
- docker-compose 文件
version: "3"
services:
playground:
build: ./
image: dalongrong/asyncapi-playground:1.2.0
ports:
- "5000:5000"
- 构建&&启动
docker-compose build && docker-compose up -d
- 效果
- 说明
镜像也已经push dockerhub了dalongrong/asyncapi-playground:1.2.0
generator
可以方便的通过yaml 定义文件生成代码,前边有使用过
参考资料
https://github.com/asyncapi/playground
https://github.com/asyncapi/editor