-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(demo-consul): add consul demo module
- Loading branch information
1 parent
5ec88d0
commit c4a3573
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
demo-consul/src/main/java/com/helltractor/demo/ConsulApplication.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.helltractor.demo; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@SpringBootApplication | ||
@RestController | ||
public class ConsulApplication { | ||
|
||
@GetMapping("/") | ||
public String home() { | ||
return "Hello World!"; | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ConsulApplication.class, args); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server: | ||
port: 8080 | ||
|
||
spring: | ||
application: | ||
name: demo-consul | ||
cloud: | ||
consul: | ||
discovery: | ||
register: true | ||
hostname: localhost | ||
port: 8500 |