Create projects directly using IDEA

1. Create a new project

2. Select Spring Initalizr

Select initialize component Web

Wait for the project to build successfully

Create a new HelloController class under the com.longdi. helloWorld package

package com.longdi.helloworld.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author: * @description * @date: 2021/9/29 13:03 * / @ RestController public class HelloController {/ / interface: http://localhost:8080/hello @requestMapping ("hello") public String hello(){return "hello world"; }}Copy the code

The project structure

Start the project and display HelloWorld! In your browser.

http://localhost:8080/hello

It takes just a few steps to develop a Web interface, and SpringBoot is that simple

To jar the project, click Maven’s package

If the packaging succeeds, a JAR package is generated in the target directory

Once you’ve made a JAR package, you can run it anywhere!

How do I change the letters of the characters displayed at startup, namely the banner pattern

Just one step: Go to the Resources directory of your project and create a new banner. TXT.

SpringBoot is so easy to operate that we go on a wave of source code analysis!

Welcome to my Github: github.com/dragon-idea