KOTLIN_CONFIGURATION_FILE_CONTENT
private val KOTLIN_CONFIGURATION_FILE_CONTENT: String = "
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
import org.springframework.web.servlet.resource.PathResourceResolver
/**
* The `ResourceConfigs` class is useful to set the configuration of the resources to correctly serve the
* images by the server
*
* @author N7ghtm4r3 - Tecknobit
* @see WebMvcConfigurer
*/
@Configuration
class ResourcesConfig : WebMvcConfigurer {
/**
* Add handlers to serve static resources such as images, js, and, css
* files from specific locations under web application root, the classpath,
* and others.
*
* @see ResourceHandlerRegistry
*/
override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
registry.addResourceHandler("/**")
.addResourceLocations("file:<list>")
.setCachePeriod(0)
.resourceChain(true)
.addResolver(PathResourceResolver())
}
}"
KOTLIN_CONFIGURATION_FILE_CONTENT
the
content of the WebMvcConfigurer,
as Kotlin class, to allow the serve of the static resources by the backend