Skip to content

Commit fbfb743

Browse files
xujinxujin
authored andcommitted
修改文档如何打开支持单nacos
1 parent e9841e4 commit fbfb743

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,17 @@ spring:
291291
</dependency>
292292
```
293293

294-
主入口程序代码修改打开
295-
296-
```java
297-
/**
298-
* 单nacos或单eureka需要把@EnableDiscoveryClient注释打开
299-
*/
300-
@EnableDiscoveryClient
301-
@ComponentScan("org.xujin.moss.*")
302-
public class MossApplication {
303-
304-
}
294+
yml文件配置如下
295+
```yml
296+
spring:
297+
application:
298+
name: halo-moss
299+
cloud:
300+
nacos:
301+
discovery:
302+
server-addr: 127.0.0.1:8848
305303
```
306304
307-
308305
## 5.致谢
309306
310307
Moss中的moss-adapter-cloud和moss-core模块部分代码参考了 [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin),感谢 Codecentric 开源了该框架。

moss-web/src/main/java/org/xujin/moss/MossApplication.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package org.xujin.moss;
22

3-
import com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor;
4-
import com.ulisesbocchio.jasyptspringboot.encryptor.SimplePBEStringEncryptor;
53
import de.codecentric.boot.admin.server.config.EnableAdminServer;
6-
import org.jasypt.encryption.StringEncryptor;
7-
import org.springframework.beans.factory.annotation.Autowired;
84
import org.springframework.boot.SpringApplication;
95
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
106
import org.springframework.boot.web.server.ConfigurableWebServerFactory;
@@ -26,10 +22,7 @@
2622
@EnableAutoConfiguration
2723
@EnableAdminServer
2824
//@EnableScheduling
29-
/**
30-
* 单nacos或单eureka需要把@EnableDiscoveryClient注释打开
31-
*/
32-
//@EnableDiscoveryClient
25+
@EnableDiscoveryClient
3326
@ComponentScan("org.xujin.moss.*")
3427
public class MossApplication {
3528

0 commit comments

Comments
 (0)