Skip to content

Commit

Permalink
feat(demo-consul): add consul demo module
Browse files Browse the repository at this point in the history
  • Loading branch information
helltractor committed Dec 24, 2024
1 parent 5ec88d0 commit c4a3573
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
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);
}

}
12 changes: 12 additions & 0 deletions demo-consul/src/main/resources/application.yml
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

0 comments on commit c4a3573

Please sign in to comment.