عرض عملي: أول تطبيق Spring Boot من Initializr إلى نقطة نهاية تعمل
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
go from nothing to a running app answering /actuator/health; prepares JNR-008-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Open Initializr; pick Maven, Java, current Boot; name it
shop-api. - Add Spring Web, Validation, Actuator. Download and unzip; open in the IDE.
- Planned mistake: add five extra starters "just in case" and watch startup grow and fail on a missing database setting. Fix: remove everything you do not need.
- Run
./mvnw spring-boot:runand read the startup log (port, "Started ShopApiApplication"). - Open
http://localhost:8080/actuator/healthand see{"status":"UP"}. - Stop the app with Ctrl+C.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.