Property configuration: Configuring in Application.properties
First step: Configure the port number and project name and start
Step two: View requests in the browser
The second configuration: configured in APPLICATION.YML. (more commonly used)
Note: Two profiles retain only one other delete
First step: Configure and start the Project project
Step two: View the request in the browser
Custom property Configuration:
First step: Configure custom properties in Application.yml
Step two: Invoke and start the project in the controller
Step three: Browser view requests
Configuration content used in configuration:
First step: Configure custom properties in Application.yml
Step two: Invoke and start the project in the controller
Step three: Browser view requests
Custom configuration becomes automatic Configuration object Common Properties
First step: Configure custom properties in Application.yml
Step two: Create a Girlproperties object
Step three: Invoke and start the project in the controller
Fourth Step: Browser View request
Configuration file Invocation:
There are two configuration files for the development environment Profile APPLICATION-DEV.YML and for the production environment, respectively APPLICATION-PROD.YML
Development environment configuration file Application-dev.yml
Configuration file for production environment APPLICATION-PROD.YML
The first step: Configure the calling development environment configuration file
Or configure the Invoke production environment configuration file
Step two: Start the project and view the request in the browser
Or
configuration file Invocation: The second way terminal calls
The first step: Open the terminal into the project and directory:
Input command: Cd/users/liuxiaoming/documents/software/ideawork/girl (based on the actual address of your project)
Step two: Compile the project
Input command: mvn install
Step three: Enter the target file to find the jar file for the project
Fourth Step:
Input: Java-jar Girl-0.0.1-snapshot.jar--spring.profiles.active=prod
Invoking a production configuration file to start a project
Fifth Step: Browser View request
At this point, you configure the development environment and start the project in the idea configuration file. The development is now running at the same time as the production environment
Spring Boot QuickStart 2: Property configuration