Skip to content

Commit c1c6b86

Browse files
author
YunaiV
committed
提供用于 APIXSIX 负载均衡的项目
1 parent b53f0a7 commit c1c6b86

File tree

6 files changed

+91
-0
lines changed

6 files changed

+91
-0
lines changed

lab-56/lab-56-demo01/pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.2.2.RELEASE</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
11+
<modelVersion>4.0.0</modelVersion>
12+
13+
<artifactId>lab-56-demo01</artifactId>
14+
15+
<dependencies>
16+
<!-- 实现对 Spring MVC 的自动化配置 -->
17+
<dependency>
18+
<groupId>org.springframework.boot</groupId>
19+
<artifactId>spring-boot-starter-web</artifactId>
20+
</dependency>
21+
</dependencies>
22+
23+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package cn.iocoder.springboot.lab56;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class Demo01Application {
8+
9+
public static void main(String[] args) {
10+
System.setProperty("server.port", "18080"); // 端口 18080
11+
SpringApplication.run(Demo01Application.class, args);
12+
}
13+
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package cn.iocoder.springboot.lab56;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class Demo02Application {
8+
9+
public static void main(String[] args) {
10+
System.setProperty("server.port", "28080"); // 端口 28080
11+
SpringApplication.run(Demo02Application.class, args);
12+
}
13+
14+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cn.iocoder.springboot.lab56.controller;
2+
3+
import org.springframework.beans.factory.annotation.Value;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
import org.springframework.web.bind.annotation.RestController;
7+
8+
@RestController
9+
@RequestMapping("/demo")
10+
public class DemoController {
11+
12+
@Value("${server.port}")
13+
private Integer serverPort;
14+
15+
@GetMapping("/echo")
16+
public String echo() {
17+
return "echo:" + serverPort;
18+
}
19+
20+
}

lab-56/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>labs-parent</artifactId>
7+
<groupId>cn.iocoder.springboot.labs</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>lab-56</artifactId>
13+
<packaging>pom</packaging>
14+
<modules>
15+
<module>lab-56-demo01</module>
16+
</modules>
17+
18+
19+
</project>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<module>labx-19</module>
8989
<module>labx-20</module>
9090
<module>lab-55</module>
91+
<module>lab-56</module>
9192

9293
</modules>
9394

0 commit comments

Comments
 (0)