GithubHelp home page GithubHelp logo

n040661 / parliament Goto Github PK

View Code? Open in Web Editor NEW

This project forked from burnettzhong/parliament

0.0 0.0 0.0 1.35 MB

API governance tool for Spring Boot application

License: Apache License 2.0

Java 3.66% CSS 0.01% HTML 0.22% JavaScript 96.10%

parliament's Introduction

Parliament

Parliament is an API document center for microservice architecture based on SpringFox and Swagger. It aims to manage all APIs of individual microservices in one place.

The idea comes from GrokOla who provides a featured Wiki for dev teams. If you find Parliament is not enough for you, please take a look at GrokOla.

How to run Parliament server

Prerequisites

This project is implemented using Spring Boot, and MongoDB for database.

  • Java 1.8
  • Maven
  • MongoDB

Config Database

Modify MongoDB configurations in application.properties:

spring.data.mongodb.host = _MongoDB address_
spring.data.mongodb.database = _MongoDB database name_
spring.data.mongodb.port = _MongoDB port_

Build and Start up

Use following command to start:

mvn package && java -jar target/Parliament-1.0.0.jar

Publish API information

This section is only for Spring Boot application.

To publish API information to Parliament server, please use:

CAUTION: for khs-spring-boot-publish-swagger-starter, please do not use original one from Keyhole Software, since there are several bugs. I have created pull request to them, if they merge my code, I will update this section.

  1. Build and add khs-spring-boot-publish-swagger-starter dependency, run following command:

     git clone https://github.com/burnettzhong/khs-spring-boot-publish-swagger-starter
     cd khs-spring-boot-publish-swagger-starter
     mvn clean install
    
  2. Add maven dependencies

     <dependency>
         <groupId>io.springfox</groupId>
         <artifactId>springfox-swagger2</artifactId>
         <version>2.6.1</version>
     </dependency>
     <dependency>
         <groupId>com.keyholesoftware</groupId>
         <artifactId>khs-spring-boot-publish-swagger-starter</artifactId>
         <version>1.0.2</version>
     </dependency>
    
  3. Configure your Spring Boot application for Swagger and push API information to Parliament server. Simply add @EnableSwagger2 and @PublishSwagger annotations.

     @EnableSwagger2
     @PublishSwagger
     public class ServiceApplication {
         ...
     }
    

For more information about Swagger2 usage, please visit Springfox Reference Documentation.

  1. Add the following properties your application.yml file:

    swagger:
         publish:
             publish-url: http://{_Parliament server address_}/swagger/publish/
             swagger-url: http://127.0.0.1:${server.port}/v2/api-docs
    

That's all! Now you can start your Spring Boot application, the API information will be published to Parliament Server automatically.

Visit API information

Open http://{Parliament Server address}/index.html, you will see a list of all your microservices, then you can see more details if click on them.

License

Copyright 2017 Han Zhong - @burnettzhong

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0

parliament's People

Contributors

burnettzhong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.