- Hands-On Microservices with Kotlin
- Juan Antonio Medina Iglesias
- 181字
- 2021-06-30 19:10:56
Creating an application object
The @SpringBootApplication annotation provides a convenient way to bootstrap a Spring application that can be started from a main() method. In many situations, you can just delegate to the static runApplication method:
@SpringBootApplication
class Chapter2Application
fun main(args: Array<String>) {
runApplication<Chapter2Application>(*args)
}
You can see that we have used the @SpringBootApplication annotation for marking a class that we will use as our application context. We will learn more about the Spring Application Context shortly.
When a Spring Boot application starts it will autoconfigure all the required systems; if it is a web app, it will start a web application.
Spring Boot provides an embedded Tomcat server that will start when our application starts. This is a fully functional server, so it's not required to deploy our software in any application server. However, Spring allows us to do it. We will discuss more on this in the section: Packing and running a Spring Boot application.
The application will also configure and run any other system that we need, such as a connection pool to a database or a queue.
推薦閱讀
- 高手是如何做產品設計的(全2冊)
- ClickHouse性能之巔:從架構設計解讀性能之謎
- DevOps with Kubernetes
- ReSharper Essentials
- Visual Basic程序開發(學習筆記)
- Mastering Selenium WebDriver
- 深入實踐Spring Boot
- Unity Virtual Reality Projects
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- Flutter跨平臺開發入門與實戰
- Swift細致入門與最佳實踐
- Salesforce Reporting and Dashboards
- C#實踐教程(第2版)
- Creating Data Stories with Tableau Public
- Spring Boot從入門到實戰