Swagger to Envoy
Simple cli tool to convert swagger definition to envoy edge proxy using Nodejs and oclif framework and a shell script to creat and run a docker continer
Pre-requisite
- node.js
- Docker
Installation
You can install toenvoy
either through npm
or by cloning the code from this GitHub repo. This README covers the installation steps with npm
.
Setup
- Run the following command in the terminal
$ npm install -g toenvoy
Runnig the Cli-Tool
Metord 1)
- Navigate to the location where the swagger file is located Make Sure the swagger file is named as swagger.yaml
- Run the command 'toenvoy' This will create a directory called envoy-proxy in the current directory.
Methord 2)
-
Navigate to the location where the swagger/OAS definition is located
-
Run the command 'toenvoy -n=${filename.yaml}' This will create a directory called envoy-proxy in the current directory.
Buiding and Runnig the Docker Container
- Once the
envoy-proxy
directory is genarated navigate in to the folder - Make
run.sh
file executable - Run the file
run.sh
This will create an Docker container which runs on port :10000
Command reference and examples
toenvoy
Generates Envoy Proxy bundle in the folder calle envoy-proxy from Swagger specification file named as swagger.yaml.
Example
Methord 1)
$ toenvoy$ cd envoy-proxy$ chmod 777 run.sh$ ./run.sh
Methord 2)
$ toenvoy -n=myfile.yaml$ cd envoy-proxy$ chmod 777 run.sh$ ./run.sh
Credits - oclif framework https://oclif.io