Created
November 11, 2022 11:14
-
-
Save migueldoctor/5a3466f0b022c6f856cbddc64880bbcc to your computer and use it in GitHub Desktop.
SpringBoot application entry point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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