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

***

[Documentation](../../../README) / [@zerotal/inertia](../README) / inertiaRoute

# Function: inertiaRoute()

> **inertiaRoute**(`path`, `component`, `props?`, `middleware?`): [`RouteRegistration`](../../core/index/interfaces/RouteRegistration)

Defined in: [inertia/src/route.ts:25](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/inertia/src/route.ts#L25)

Register a GET route that renders an Inertia page directly — no controller
needed for controller-less pages.

Useful for static/simple pages (about, dashboards) that need no controller logic —
the generated handler just calls [inertia](inertia) with the given component and props.

## Parameters

### path

`string`

The URL path to register (GET).

### component

`string`

The page component name/path (relative to the pages dir, no extension).

### props?

`Record`\<`string`, `unknown`\> \| [`MiddlewareClass`](../../core/index/type-aliases/MiddlewareClass)[]

Static props object, **or** a middleware array as a shorthand (when it's an array it's treated as middleware, not props).

### middleware?

[`MiddlewareClass`](../../core/index/type-aliases/MiddlewareClass)[] = `[]`

Middleware to apply (ignored when `props` is used as the middleware-array shorthand).

## Returns

[`RouteRegistration`](../../core/index/interfaces/RouteRegistration)

The route registration from the underlying `Router.get`.

## Example

```ts
Router.inertia('/about', 'About/Index');
Router.inertia('/home',  'Home/Index', { greeting: 'Hello' });
Router.inertia('/admin', 'Admin/Dashboard', [AuthMiddleware]);
```
