Skip to content

Instantly share code, notes, and snippets.

@migueldoctor
Created November 11, 2022 11:14
Show Gist options
  • Save migueldoctor/5a3466f0b022c6f856cbddc64880bbcc to your computer and use it in GitHub Desktop.
Save migueldoctor/5a3466f0b022c6f856cbddc64880bbcc to your computer and use it in GitHub Desktop.
SpringBoot application entry point
package com.kesizo.demo.services.uploadfilesservice
import com.kesizo.demo.services.uploadfilesservice.service.UploadFileService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
@SpringBootApplication
class UploadFilesServiceApplication : CommandLineRunner {
@Autowired
lateinit var uploadFileService: UploadFileService
override fun run(vararg args: String?) {
uploadFileService.init()
.onFailure { throw RuntimeException("System cannot start up because no uploads folder is set up") }
}
}
fun main(args: Array<String>) {
runApplication<UploadFilesServiceApplication>(*args)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment