application.yml والـ Profiles
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
configure the app with YAML and switch profiles.
الموضوعات المخطط لها
application.ymlholds settings in a readable tree;.propertiessays the same in flat form.- A profile is a named set of settings, such as
devorprod. - Profile files:
application-dev.yml,application-prod.yml; they add to or override the base file. - Activate with
spring.profiles.active=devor the environment variableSPRING_PROFILES_ACTIVE.
تفاصيل المخطط المبدئي
عرض عملي
# application.yml
shop:
currency: EUR
---
# application-dev.yml
shop:
currency: USDاختبر فهمك
How do you choose the prod profile without editing files?
أظهر الإجابة
Set SPRING_PROFILES_ACTIVE=prod.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.