Skip to content

Commit aa52921

Browse files
Merge pull request #20 from andreformento/master
Implement shutdown controller
2 parents 693d726 + 3e95de1 commit aa52921

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package br.com.concrete.mock.infra.controller;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.boot.SpringApplication;
5+
import org.springframework.context.ApplicationContext;
6+
import org.springframework.web.bind.annotation.RequestMapping;
7+
import org.springframework.web.bind.annotation.RestController;
8+
9+
import static org.springframework.web.bind.annotation.RequestMethod.POST;
10+
11+
@RestController
12+
public class ShutdownController {
13+
14+
@Autowired
15+
private ApplicationContext appContext;
16+
17+
@RequestMapping(value = "/shutdown", method = POST)
18+
public void initiateShutdown() {
19+
SpringApplication.exit(appContext);
20+
}
21+
}

0 commit comments

Comments
 (0)