Skip to content

Commit c4a3573

Browse files
committed
feat(demo-consul): add consul demo module
1 parent 5ec88d0 commit c4a3573

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.helltractor.demo;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.web.bind.annotation.GetMapping;
6+
import org.springframework.web.bind.annotation.RestController;
7+
8+
@SpringBootApplication
9+
@RestController
10+
public class ConsulApplication {
11+
12+
@GetMapping("/")
13+
public String home() {
14+
return "Hello World!";
15+
}
16+
17+
public static void main(String[] args) {
18+
SpringApplication.run(ConsulApplication.class, args);
19+
}
20+
21+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
server:
2+
port: 8080
3+
4+
spring:
5+
application:
6+
name: demo-consul
7+
cloud:
8+
consul:
9+
discovery:
10+
register: true
11+
hostname: localhost
12+
port: 8500

0 commit comments

Comments
 (0)