繁体   English   中英

如何使用 Spring 引导和 Kotlin 启动 web 应用程序

[英]How to start the web application with Spring Boot and Kotlin

我现在正在阅读本教程。

教程说

Start the web application by running the main function of BlogApplication.kt, and go to http://localhost:8080/ , you should see a sober web page with a "Blog" headline.

如何使用 Spring 引导和 Kotlin 启动 web 应用程序?

我根据教程编写了BlogApplication.kt如下

package com.example.blog

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class BlogApplication

fun main(args: Array<String>) {
  runApplication<BlogApplication>(*args)
}

我使用Gradle

两种选择:

  1. 在您的 IDE 中,右键单击main function 并选择“运行”
  2. 使用 Gradle,在终端中运行./gradlew bootRun

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM