阅读(4929) (0)

Micronaut 服务静态资源

2023-02-23 11:24:54 更新

默认启用静态资源解析。 Micronaut 支持从类路径或文件系统解析资源。

有关可用的配置选项,请参阅以下信息:

表 1. StaticResourceConfiguration 的配置属性
属性 类型 描述

micronaut.router.static-resources.*.enabled

boolean

设置是否启用此特定映射。默认值(真)。

micronaut.router.static-resources.*.paths

java.util.List

以 classpath: 或 file: 开头的路径列表。您可以从磁盘或类路径上的任何位置提供文件。例如,要从 src/main/resources/public 提供静态资源,您可以使用 classpath:public 作为路径。

micronaut.router.static-resources.*.mapping

java.lang.String

应从中提供路径资源。使用 ant 路径匹配。默认值 (”/**”)。