> For the complete documentation index, see [llms.txt](https://programmingfundamental.gitbook.io/programmingwithjava/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://programmingfundamental.gitbook.io/programmingwithjava/internet-tekhnologii-2023/laboratorno-uprazhnenie-6/struktura-na-spring-boot-proekt/upravlenie-na-konfiguraciyata-s-application.properties.md).

# Управление на конфигурацията с application.properties

Spring Initializr генерира празен файл application.properties в папката src/main/resources. Този файл със свойства ви позволява да зададете различни конфигурации на приложението (напр. подробности за сървъра или подробности за базата данни). Въпреки че има множество начини за задаване на properties на Spring Boot приложение, това е най-често използваният подход. Този файл със свойства ви позволява да укажете конфигурациите във формат на двойка ключ-стойност, където ключът е отделен от свързаната стойност със знак =. Следващата фигура показва примерна конфигурация в application.properties файл за конфигуриране на адреса на сървъра и порта на Spring Boot приложение.

<figure><img src="/files/WNLmpNghuo95ckdmaGFb" alt=""><figcaption></figcaption></figure>

За да видите файла application.properties на практика, можете да промените стойността на server.port в текущото приложение до различна стойност на HTTP порт (напр. до 9090). Ако стартирате приложението след тази модификация, можете да видите, че стартира на актуализирания HTTP порт.

Ако не харесвате този файлов формат, можете алтернативно да използвате файловия формат YAML (<https://yaml.org/spec/1.2.2/>), за да конфигурирате свойствата на приложението. YAML ви позволява да дефинирате йерархично свойствата. Ако искате да използвате файловия формат YAML, можете да преименувате съществуващия файл application.properties на application.yml и да зададете свойствата във YAML формат. &#x20;

![](/files/Bslkt3touWeKKJu0kFzH)

Можете да откриете  списък на поддържаните свойства от application.properties  на уебсайта на Spring Boot (<https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html>).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://programmingfundamental.gitbook.io/programmingwithjava/internet-tekhnologii-2023/laboratorno-uprazhnenie-6/struktura-na-spring-boot-proekt/upravlenie-na-konfiguraciyata-s-application.properties.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
