Carter
12/08/2023, 3:21 PMresource
API:
Assets.entries.forEach {
resource(
it.hashedPath, // asset/js/browser-app-af00f73c8693fe418e83b020c04d3e78324a1e7dc5a0dd3784de87f66d9ebf68.js
it.defaultPath // asset/js/browser-app.js
)
}
This does not work, using staticResources
.
Assets.entries.forEach {
staticResources(
it.hashedPath, // asset/js/browser-app-af00f73c8693fe418e83b020c04d3e78324a1e7dc5a0dd3784de87f66d9ebf68.js
it.basePackage // asset/js
) {
default(it.defaultPath) // asset/js/browser-app.js
}
}
Is there a way to do this better with the staticResources
or another Ktor API?Aleksei Tirman [JB]
12/08/2023, 4:29 PMAssets.entries.forEach { entry ->
get(entry.hashedPath) {
val resource = call.resolveResource(entry.defaultPath)
if (resource != null) call.respond(resource)
}
}
Carter
12/08/2023, 7:38 PMresolveResource
was the challenge!Carter
12/08/2023, 7:41 PMAleksei Tirman [JB]
12/09/2023, 11:54 AMCarter
01/29/2024, 5:21 PM