changing the name of a module
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user