Skip to content

Commit

Permalink
提供用于 APIXSIX 负载均衡的项目
Browse files Browse the repository at this point in the history
  • Loading branch information
YunaiV committed May 1, 2020
1 parent b53f0a7 commit c1c6b86
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lab-56/lab-56-demo01/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>lab-56-demo01</artifactId>

<dependencies>
<!-- 实现对 Spring MVC 的自动化配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cn.iocoder.springboot.lab56;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Demo01Application {

public static void main(String[] args) {
System.setProperty("server.port", "18080"); // 端口 18080
SpringApplication.run(Demo01Application.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cn.iocoder.springboot.lab56;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Demo02Application {

public static void main(String[] args) {
System.setProperty("server.port", "28080"); // 端口 28080
SpringApplication.run(Demo02Application.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cn.iocoder.springboot.lab56.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class DemoController {

@Value("${server.port}")
private Integer serverPort;

@GetMapping("/echo")
public String echo() {
return "echo:" + serverPort;
}

}
19 changes: 19 additions & 0 deletions lab-56/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>labs-parent</artifactId>
<groupId>cn.iocoder.springboot.labs</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>lab-56</artifactId>
<packaging>pom</packaging>
<modules>
<module>lab-56-demo01</module>
</modules>


</project>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<module>labx-19</module>
<module>labx-20</module>
<module>lab-55</module>
<module>lab-56</module>

</modules>

Expand Down

0 comments on commit c1c6b86

Please sign in to comment.