hello world

This commit is contained in:
ityurner02@mail.ru 2023-02-13 19:45:31 +04:00
parent 52782b603d
commit 7da8c7ee3c

View File

@ -2,12 +2,19 @@ package ru.ulstu.is.lab1;
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 Lab1 {
public static void main(String[] args) {
SpringApplication.run(Lab1.class, args);
}
@GetMapping("/hello")
public String hello(@RequestParam(value = "name", defaultValue = "World") String name) {
return String.format("Hello %s!", name);
}
}