A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://nx.dev/technologies/angular/angular-rsbuild/api/create-server below:

Website Navigation


createServer - @nx/angular-rsbuild/ssr | Nx

import { createServer } from '@nx/angular-rsbuild/ssr';

The createServer function is used to setup Angular's CommonEngine using an express server. It takes the bootstrap function as an argument, which is the function that bootstraps the Angular server application. This is usually main.server.ts. It returns RsbuildAngularServer which contains the server instance to allow further modifications as well as the listen method to start the server.

function createServer(bootstrap: any): RsbuildAngularServer;

The following example shows how to create a standard express server:

myapp/src/server.ts

import { createServer } from '@nx/angular-rsbuild/ssr'; import bootstrap from './main.server'; const server = createServer(bootstrap); server.listen();

export interface RsbuildAngularServer { app: express.Express; listen: (port?: number) => void; }

app

express.Express The express application instance.

listen

(port?: number) => void Starts the express application on the specified port. If no port is provided, the default port (4000) is used.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4