All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.octopusden.employee.config.WebConfig.kt Maven / Gradle / Ivy

package org.octopusden.employee.config

import org.springframework.context.annotation.Configuration
import org.springframework.core.convert.converter.Converter
import org.springframework.format.FormatterRegistry
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
import java.time.LocalDate

@Configuration
class WebConfig : WebMvcConfigurer {

    override fun addViewControllers(registry: ViewControllerRegistry) {
        registry.addRedirectViewController("/", "swagger-ui/index.html")
    }

    override fun addFormatters(registry: FormatterRegistry) {
        registry.addConverter(object : Converter {
            override fun convert(source: String): LocalDate {
                return LocalDate.parse(source)
            }
        })
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy