乘客服务注册到nacos

master
kezhen0805 2 years ago
parent 56d6d4b3cd
commit 81b7f6530f

@ -16,6 +16,12 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2021.1</version>
</dependency>
</dependencies> </dependencies>
<properties> <properties>

@ -2,6 +2,7 @@ package com.mashibing.apipassenger;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/** /**
* @author kezhen * @author kezhen
@ -9,6 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @description * @description
*/ */
@SpringBootApplication @SpringBootApplication
@EnableDiscoveryClient
public class ApiPassengerApplication { public class ApiPassengerApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ApiPassengerApplication.class); SpringApplication.run(ApiPassengerApplication.class);

@ -1,2 +1,11 @@
server: server:
port: 8081 port: 8081
spring:
application:
name: api-passenger
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848

Loading…
Cancel
Save