Hands to build micro-services framework and test environment -9- router

1 Examples

( 1 ) create a sample micro-business services

First, dependence Spring-Boot-Starter-Web .

Then, modify the Application :

image.png


Finally, modify Application.properties:

image.png


( 2 ) create a gateway

First, dependence Spring-Boot-Starter-Web , Spring-Cloud-Starter-Netflix-Zuul .

Then, modify the Application category:

image.png


Add filter:

image.png


Finally, modify application.properties:

image.png


( 3 ) Testing

Start micro-services, port 8090.

Start the gateway, the port is 8080.

In the browser Chrome visit:

image.png

This time, the show gateway command line:

image.png



Guess you like

Origin blog.51cto.com/5526964/2426404