The following is the CV to run introductory demo (fake test data)
First, create a project (maven create an empty project, not applicable here scaffolding created)
Second, add dependencies
Note: SpringBoot provide a project called spring-boot-starter-parent's, which has been dependent on a variety of common (but not all) of version management, our project need to be the parent of this project works, so we do not worry about the version of the problem dependent, dependent on what is required, can be introduced directly into the coordinates!
Import coordinate parent project
1 <parent>
2 <groupId>org.springframework.boot</groupId>
3 <artifactId>spring-boot-starter-parent</artifactId>
4 <version>2.1.6.RELEASE</version>
5 </parent>
Adding web launcher:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
Third, start writing class
Fourth, write controller
Fifth, start test test
When the starting class observed log
Test results directly in a browser