Hackerss.com

hackerss
hackerss

Posted on

Restful service with springboot in Java

Restful service with springboot - Java:


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorld {

   /**
   * This method return a String with the message "Hello World".
   * @return String Obtains the message "Hello World".
   */   
   @RequestMapping(value = "/hello", method = RequestMethod.GET)
   public String hello() {
      return "Hello World";
   }
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)