Created
September 1, 2020 02:37
-
-
Save andipyk/2c1a0f5a7597b5290bb8c4d750138de9 to your computer and use it in GitHub Desktop.
Demo Spring Boot 1
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
package com.andipyk.spring01.demo; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
import org.springframework.web.bind.annotation.RestController; | |
@SpringBootApplication | |
@RestController | |
public class DemoApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(DemoApplication.class, args); | |
} | |
@GetMapping("/hello") | |
public String hello(@RequestParam(value = "name", defaultValue = "World") String name) { | |
return String.format("Hello %s !", name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment