Skip to content

Commit ae9a038

Browse files
committed
Updating RestServer/RestApplication.java to accept an app name from outside
- This will help us to launch and verify the app which the client is talking to - Updating pom.xml to avoid warning during 'mvn compile' command
1 parent 34dc2e1 commit ae9a038

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
</dependency>
112112
</dependencies>
113113
<build>
114+
<finalName>magmadocloader/magmadocloader</finalName>
114115
<pluginManagement>
115116
<plugins>
116117
<plugin>
@@ -183,7 +184,6 @@
183184
<Class-Path>.</Class-Path>
184185
</manifestEntries>
185186
</archive>
186-
<finalName>magmadocloader/magmadocloader</finalName>
187187
</configuration>
188188
</plugin>
189189
</plugins>

src/main/java/RestServer/RestApplication.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6+
import org.springframework.beans.factory.annotation.Value;
67
import org.springframework.boot.SpringApplication;
78
import org.springframework.boot.autoconfigure.SpringBootApplication;
89
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
@@ -24,10 +25,13 @@ public static void main(String[] args) {
2425
class RestHandlers {
2526
public static Logger logger = LogManager.getLogger(RestHandlers.class);
2627

28+
@Value("${server.name:java_doc_loader}")
29+
private String serverName;
30+
2731
@GetMapping(value={"/check-online", "/"})
2832
public ResponseEntity<Map<String, Object>> CheckOnline(){
2933
Map<String, Object> body = new HashMap<>();
30-
body.put("name", "java_doc_loader");
34+
body.put("name", serverName);
3135
body.put("status", true);
3236
return new ResponseEntity<>(body, HttpStatus.OK);
3337
}
@@ -170,4 +174,4 @@ public ResponseEntity<Map<String, Object>> reset_task_manager(@RequestBody TaskR
170174
public void shutdownApp() {
171175
System.exit(0);
172176
}
173-
}
177+
}

0 commit comments

Comments
 (0)