• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Combines all swagger documents in microservices

Build Status

NPM

If you are building a microservice system and using Swagger.

This packet is able to help you combine all swagger documents to only one document.

For example, you have the swagger documents at http://service1/docs, http://service2/docs

This will help you combine all links above to only one link http://service/docs

NOTE: If you need Gulp, ES6 and somethings more, please see branch added_gulp

Installation & Run from Docker

docker run -d -p 3000:3000 thanhson1085/swagger-combined

Configuration file

See config/default.json as below:

{
    "list_url": [
        {
            "docs": "http://petstore.swagger.io/v2/swagger.json",
            "base_path": "http://petstore.swagger.io/v2",
            "route_match": ["/user*", "/pet*", "/store*"]
        }
    ],
    "info": { "title": "Example API", "version": "1.0" },
    "port": 3000
}
  • docs: swagger document links
  • base_path: Proxy Target
  • route_match: Routes for proxy

Please make note that you changed config/default.json to match all swagger document links you have

Installation & Run from Source Code

git clone https://github.com/thanhson1085/swagger-combined.git

Run:

cd swagger-combined
npm install
node index.js

Test

In the default, swagger-combined run on port 3000 and included swagger-ui. So you just run http://localhost:3000?url=http://localhost:3000/docs to see everything you need. Or you can see swagger api at http://localhost:3000/docs

Example & Demo

With config/default.json:

{
    "list_url": [
        {
            "docs": "http://petstore.swagger.io/v2/swagger.json",
            "base_path": "http://petstore.swagger.io/v2",
            "route_match": ["/user*", "/pet*", "/store*"]
        },
        {
            "docs": "https://angular-admin-seed.sonnguyen.ws/docs",
            "base_path": "https://angular-admin-seed.sonnguyen.ws",
            "route_match": ["/api/v1*"]
        }
    ],
    "info": { "title": "Example API", "version": "1.0" },
    "port": 3000
}

License (MIT)

Copyright (c) 2015 Nguyen Sy Thanh Son [email protected]

More Repositories

1

python-kafka-avro

A simple examle for Python Kafka Avro
Python
86
star
2

bean-seed

DevOps Microservices NodeJS Starter Project
JavaScript
51
star
3

DemoCoin

Create ECR20 Token Sale in Step by Step
JavaScript
45
star
4

convert-contract-abi-online

Convert Ethereum Contract ABI Online
Vue
29
star
5

flask-celery-rabbitmq-generate-thumbnail

Flask + Celery + RabbitMQ example
Python
27
star
6

Hello-AI

AI, Tensorflow, Inceptionv3, AI as a Service, Flask
Python
24
star
7

python-s3

A simple exampe to upload and download file by using Flask and Boto3
Python
18
star
8

slack-jenkins

A simple example for "trigger a Jenkins build from Slack with parameters"
PHP
15
star
9

VET

Vietnam Ethereum Testnet
Shell
8
star
10

microservices-swarm-consul

A example to run microservices with Docker Swarm and Consul
Shell
7
star
11

angular-admin-seed

Starting a CMS with AngularJS, ExpressJS, Grunt, Bower, Karma, PhantomJS, JShint, SB Admin 2
HTML
7
star
12

angularjs-mqtt

A simple MQTT Provider for Angular 1.X
JavaScript
6
star
13

pwgen

Password Generator
Vue
5
star
14

docker-mysql-replication

Docker Mysql Replication Master-Slave
Shell
5
star
15

thrift-laravel

Tutorial Hello World with Apache Thrift (Laravel + Python in Server)
PHP
5
star
16

go-crawler-worker-queues

A example to crawl data using Golang Worker Queues
Go
4
star
17

nginx-autoreload

Docker Nginx autoreload with Inotify
Shell
4
star
18

video-live-stream-server

Video Live Stream server with Nginx
Nginx
3
star
19

Test-Online

PHP
3
star
20

CuteFlow-V4

Version 4 of the Workflow System CuteFlow
PHP
3
star
21

moex

MoEx Project
PHP
2
star
22

PHP_MYSQL_Example

Make for KVS Training Project
PHP
2
star
23

koor-samples

C++
2
star
24

docker-cloudera-quickstart

Install Hadoop With Docker In Ubuntu 14.04
Shell
2
star
25

flask-webhdfs

Flask upload and store files in HDFS
Python
1
star
26

MyProject

PHP
1
star
27

tomochain-airdrop

JavaScript
1
star
28

MogileFS_PHP_Example

Upload Download Code PHP Example in MogileFS (Distributed File System)
PHP
1
star
29

consul-ubuntu-vagrant

Consul Demo in Ubuntu 14.04 with Vagrant
1
star
30

Hello-World

Get Started
1
star