# Source: https://rsbuild.dev/config/server/base.md

# server.base

* **Type:** `string`
* **Default:** `/`
* **Version:** `>= 1.0.10`

`server.base` is used to configure the [base path](/guide/basic/server.md#base-path) of the server.

## Example

By default, the Rsbuild server's base path is `/`. You can access output files like `index.html` and assets in the [public folder](/guide/basic/static-assets.md#public-folder) through `http://localhost:3000/`.

If you want to access `index.html` through `http://localhost:3000/foo/`, you can change `server.base` to `/foo`.

```ts title="rsbuild.config.ts"
export default {
  server: {
    base: '/foo',
  },
};
```

## URL prefix of assets

[dev.assetPrefix](/config/dev/asset-prefix.md) and [output.assetPrefix](/config/output/asset-prefix.md) will read the value of `server.base` as the default value.

When `server.base` is `/foo`, the default resource URL loaded in the browser is as follows:

```html
<script defer src="/foo/static/js/index.js"></script>
```

Then, `index.html` and static assets can be accessed through `http://localhost:3000/foo/`.

If you do not want to use this default behavior, you can override it by explicitly setting `dev.assetPrefix` / `output.assetPrefix` :

```ts title="rsbuild.config.ts"
export default {
  dev: {
    assetPrefix: '/',
  },
  output: {
    assetPrefix: 'https://cdn.example.com/assets/',
  },
  server: {
    base: '/foo',
  },
};
```