Created
September 30, 2022 11:35
-
-
Save lamoboos223/41114cec2815b44132cf611d60086b1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demohaproxy; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@SpringBootApplication | |
@RestController | |
public class DemoHaproxyApplication { | |
@Value("${server.port}") | |
String port; | |
@RequestMapping("/") | |
public String welcome(){ | |
return "port: " + port + " page: Welcome"; | |
} | |
@RequestMapping("/app1") | |
public String app1(){ | |
return "port: " + port + " page: app1"; | |
} | |
@RequestMapping("/app2") | |
public String app2(){ | |
return "port: " + port + " page: app2"; | |
} | |
public static void main(String[] args) { | |
SpringApplication.run(DemoHaproxyApplication.class, args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment