ktor-server-core / io.ktor.http.content / resolveResource

resolveResource

fun ApplicationCall.resolveResource(path: String, resourcePackage: String? = null, classLoader: ClassLoader = application.environment.classLoader, mimeResolve: (String) -> ContentType = { ContentType.defaultForFileExtension(it) }): OutgoingContent?

Parameters

path - is a relative path to the resource

resourcePackage - is a base package the path to be appended to

mimeResolve - is a function that resolves content type by file extension, optional

Return
LocalFileContent or JarFileContent or null