본문 바로가기
Dev/SpringBoot

How to Set 'application.properties/yaml' in SpringBoot

by DevHack 2023. 4. 24.
반응형

Table of Contents

  • Introduction
  • What is 'application.properties/yaml'?
  • How to Set 'application.properties/yaml' in 'SpringBoot'
  • Sample Code

Introduction

'application.properties/yaml' is an important configuration file in a 'SpringBoot' application. It contains various properties that can be used to configure the application. This blog post will provide a step-by-step guide on how to set 'application.properties/yaml' in 'SpringBoot.'

What is 'application.properties/yaml'?

'application.properties/yaml' is a configuration file that contains properties that can be used to configure a 'SpringBoot' application. These properties can be used to set various configurations such as server port, database connection, logging, etc.

How to Set 'application.properties/yaml' in 'SpringBoot'

To set 'application.properties/yaml' in 'SpringBoot,' follow these steps:

  1. Create a new file named 'application.properties/yaml' in the 'src/main/resources' folder.
  2. Add the properties that you want to set in the file.
  3. Save the file.

Sample Code

Here's an example of how to set 'application.properties/yaml' in 'SpringBoot':

# Set server port
server.port=8080

# Set database connection
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=root
spring.datasource.password=root

# Set logging
logging.level.root=INFO

That's it! By following these steps, you can easily set 'application.properties/yaml' in your 'SpringBoot' application.

반응형

'Dev > SpringBoot' 카테고리의 다른 글

'@Bean' Annotation  (0) 2023.04.24
'@Configuration' Annotation  (0) 2023.04.24
What is Thymeleaf?  (0) 2023.04.24
What is Spring Security?  (0) 2023.04.23
What is Spring Data JPA?  (0) 2023.04.23

댓글