import { Meta } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/nitro-basic/Functions/uiCreateServerApp - Full Server Initialization'/>

# `uiCreateServerApp`

A comprehensive asynchronous function to initialize the application on the server side. It configures everything necessary for SSR: headers, storage, API, routing, and performs HTML rendering.

**Key Stages:**
1. Initialization of headers, storage, and cookies.
2. Configuration of the API client and functional plugins.
3. Synchronization of the router with the current URL.
4. Rendering the application into a string.
5. Substitution of data (language, meta, scripts, content) into the HTML template.

**Returns:**
An object with the rendered page body, metadata, and headers.

## Types

### NitroAppOptions

- `api?: ApiConfig` — configuration for the API client.
- `translate?: TranslateConfig` — configuration for the translation service.
- `metaSuffix?: string` — suffix to be appended to all page titles.
- `icons?: IconsConfig` — configuration for the icon management service.
- `router?: Router` — Vue Router instance.
- `errorCauses?: ErrorCenterCauseList` — error causes list for the error center.

```typescript
import { uiCreateServerApp } from '@dxtmisha/nitro-basic'

const data = await uiCreateServerApp(app, request, router, options, action, context, htmlTemplate)
```
