Last active
August 22, 2016 16:29
-
-
Save arahansa/9b30cb85b83e8d45c6c6b6497fcf4fc6 to your computer and use it in GitHub Desktop.
죽을수 있는 스프링부트ㅋㅋ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class DeathableSpringBootApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(DeathableSpringBootApplication.class, args); | |
} | |
} | |
@RestController | |
class DefaultController{ | |
@Autowired | |
Environment env; | |
@Autowired | |
ApplicationContext appContext; | |
@GetMapping({"/", "/index"}) | |
public String index(){ | |
return "hello world, my name : "+env.getProperty("name"); | |
} | |
@GetMapping("/die") | |
public void die(){ | |
SpringApplication.exit(appContext, ()->0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment