- 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.
推薦閱讀
- Unreal Engine Physics Essentials
- 劍指JVM:虛擬機實踐與性能調優
- Machine Learning with R Cookbook(Second Edition)
- PyTorch自然語言處理入門與實戰
- Python零基礎快樂學習之旅(K12實戰訓練)
- 小程序開發原理與實戰
- HTML5秘籍(第2版)
- OpenStack Networking Essentials
- 實戰Java高并發程序設計(第2版)
- Learning Splunk Web Framework
- SQL Server 入門很輕松(微課超值版)
- C++ System Programming Cookbook
- JavaScript悟道
- MongoDB Cookbook(Second Edition)
- Oracle SOA Suite 12c Administrator's Guide