> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

# server.publicRoutes

- **类型：** `Object`
- **默认值：** 根据文件约定自动生成的服务端路由规则，每个文件生成一条路由规则。

该配置选项只作用于服务端路由，可以自定义 `config/public/` 下资源的访问路由。

对象的 `key` 为 `config/public/` 的相对文件路径（不使用 `./`）, 值可以是 `string`。

```ts title="modern.config.ts"
export default defineConfig({
  server: {
    publicRoutes: {
      // 设置一个长路由
      'index.json': '/user-config/card-info/extra/help.json',

      // 设置一个不带后缀的路由
      'robot.txt': '/app/authentication',
    },
  },
});
```
