---
title: router
---

# runtime.router

import RouterLegacyTip from "@site-docs-en/components/router-legacy-tip"

<RouterLegacyTip />

- **Type:** `boolean | Object`
- **Default:** `false`

This value is set to `true` when the project is created, supporting the use of [conventional routing](/guides/concept/entries.html#约定式路由) provided by Modern.js for routing management.

If you wish to use [controlled routing](/guides/concept/entries.html#自控式路由), please remove this value or set it to `false`.

:::note
All sub-configurations of `router` will only take effect when using conventional routing.
:::

## basename

- **Type:** `string`
- **Default:** ``

The basename option specifies the subpath where the app is deployed, for situations where it cannot be deployed to the root domain.

:::tip
推荐使用 [`server.baseUrl`](/configure/app/server/base-url) 进行配置。
:::

## supportHtml5History

- **Type:** `boolean`
- **Default:** `true`

If the value of `supportHtml5History` is `true`, `BrowserRouter` would be used, otherwise `HashRouter` would be used. `BrowserRouter` is recommended.

:::warning
When SSR is enabled, `supportHtml5History` is not supported.

:::
