简体   繁体   中英

How to start the web application with Spring Boot and Kotlin

I am reading this tutorial now.

The tutorial say

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.

How to start the web application with Spring Boot and Kotlin?

I wrote BlogApplication.kt as below according to the tutorial

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)
}

I use Gradle .

Two options:

  1. In your IDE, right click the main function and choose "Run"
  2. With Gradle, in your terminal, run ./gradlew bootRun

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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