1.新建工程如下,注意只有Ideal专业版才可以快速构建,需要破解器请拍我的闲鱼链接,绝对有效!
4.0€rGKXXnt215T€ https://m.tb.cn/h.f0noKLM 我在闲鱼发布了【IDEA破解,官方正版软件上直接破解,永远30天试用期!】
一路默认就ok
2.只需添加Spring web即可
3.粘贴代码至图中文件
package com.example.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); } }
4.运行后打开浏览器localhost:8080/hello