Skip to content

Instantly share code, notes, and snippets.

@andipyk
Created September 1, 2020 02:37
Show Gist options
  • Save andipyk/2c1a0f5a7597b5290bb8c4d750138de9 to your computer and use it in GitHub Desktop.
Save andipyk/2c1a0f5a7597b5290bb8c4d750138de9 to your computer and use it in GitHub Desktop.
Demo Spring Boot 1
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