[**Documentation**](../../../README)

***

[Documentation](../../../README) / [zerotal](../../README) / [helpers](../README) / basePath

# Function: basePath()

> **basePath**(...`segments`): `string`

Defined in: [packages/core/src/helpers/index.ts:41](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/helpers/index.ts#L41)

Resolve a path relative to the application root (`process.cwd()`).

Use in `bootstrap/app.ts` when declaring route files or directories so paths
are always resolved from the project root rather than the calling file's
directory.

## Parameters

### segments

...`string`[]

## Returns

`string`

## Example

```ts
// bootstrap/app.ts
Application.create({ providers })
  .routing({ web: basePath('routes/web.ts') })
  .fileBasedRouting({ web: basePath('app/routes') });
```
