• Overview
@angular/platform-server

bootstrapServerApplication

function
stable

Bootstraps an instance of an Angular application for the server platform.

API

function bootstrapServerApplication(
  rootComponent: Type<unknown>,
  options: ApplicationConfig,
): ServerApplicationBootstrapFn;

bootstrapServerApplication

ServerApplicationBootstrapFn

Bootstraps an instance of an Angular application for the server platform.

@paramrootComponentType<unknown>

A reference to a standalone component that should be rendered.

@paramoptionsApplicationConfig

Extra configuration for the bootstrap operation, see ApplicationConfig for additional info.

@returnsServerApplicationBootstrapFn

Usage Notes

The root component passed into this function must be a standalone.

import { bootstrapServerApplication } from '@angular/platform-server';import { ApplicationConfig } from '@angular/core';import { AppComponent } from './app.component';const bootstrap = bootstrapServerApplication(AppComponent, {  providers: [    {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'}  ]});
Jump to details