Skip to content

Instantly share code, notes, and snippets.

@arahansa
Last active August 22, 2016 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arahansa/9b30cb85b83e8d45c6c6b6497fcf4fc6 to your computer and use it in GitHub Desktop.
Save arahansa/9b30cb85b83e8d45c6c6b6497fcf4fc6 to your computer and use it in GitHub Desktop.
죽을수 있는 스프링부트ㅋㅋ
@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