-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathDiscoveryServer.java
More file actions
27 lines (21 loc) · 888 Bytes
/
DiscoveryServer.java
File metadata and controls
27 lines (21 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.example.discovery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import java.io.IOException;
@EnableEurekaServer
@SpringBootApplication
public class DiscoveryServer {
private static Logger logger = LoggerFactory.getLogger(DiscoveryServer.class);
public static void main(String... args) throws IOException {
// Look for configuration in discovery-server.properties or discovery-server.yml
System.setProperty("spring.config.name", "discovery-server");
var ctx = SpringApplication.run(DiscoveryServer.class, args);
assert (ctx != null);
logger.info("Started ...");
System.in.read();
ctx.close();
}
}