Follow the steps to complete a spring boot item (c) import template configuration items springboot

Follow the steps to complete a spring boot item (c) import template configuration items springboot

1. Open the eclipse project import spring boot, auto-configuration pom.xml download jar package.
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
After 2 eclise below autoconfiguration maven Item
Here Insert Picture Description
3 in FIG console output application running spring

Here Insert Picture Description
4 spring configuration file format we use yaml, application.properties changed application.yml file.
Here Insert Picture Description
5 Modify the start port:
We modified application.yml: There is a space between the port and start proved to be successful.

Here Insert Picture Description

6 custom banner
we can modify the console display of spring into mainserver add a baner.txt increase their character to the resources inside.
Website for online editing characters: http://patorjk.com/software/taag
Here Insert Picture Description
Here Insert Picture Description
6 test interface browser and enter http: // localhost: 8001

Here Insert Picture Description
We create a new controller package, create a test controller to add a method. If there is an error message, you can import the package.

package com.ylz.spring_boot.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

	@GetMapping(value="/hello")
	public Object hello()
	{
		return "hello spring";
	}
	
}

Here Insert Picture Description
Re-request Address: hellospring can return to normal,
HTTP: // localhost: 8001 / the Hello
Here Insert Picture Description

Published 10 original articles · won praise 0 · Views 169

Guess you like

Origin blog.csdn.net/yulizi0215/article/details/104014003