changing the name of a module

This commit is contained in:
eugenp
2016-07-27 13:19:46 +03:00
parent 603955f3f8
commit 9c9a0b23e5
13 changed files with 204 additions and 204 deletions
@@ -0,0 +1,22 @@
package com.baeldung;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class BaeldungController {
@RequestMapping(method={RequestMethod.GET},value={"/hello"})
public String sayHello(HttpServletResponse response){
return "hello";
}
@RequestMapping(method={RequestMethod.POST},value={"/baeldung"})
public String sayHelloPost(HttpServletResponse response){
return "hello";
}
}
@@ -0,0 +1,19 @@
package com.baeldung;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
@SpringBootApplication
public class SpringDemoApplication extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(SpringDemoApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
return application.sources(SpringDemoApplication.class);
}
}
@@ -0,0 +1,14 @@
package com.baeldung;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class VersionController {
@RequestMapping(method={RequestMethod.GET},value={"/version"})
public String getVersion(){
return "1.0";
}
}