Cloud API Overview > @adpt/cloud > nodejs > ReactApp
nodejs.ReactApp() function
A partially abstract component that builds ReactJS source code and serves the resulting files via an http.HttpServer.
Signature:
export declare function ReactApp(props: SFCDeclProps<ReactAppProps, typeof defaultOptions>): Adapt.AdaptElement<Adapt.AnyProps>;
Parameters
Parameter | Type | Description |
---|---|---|
props | SFCDeclProps<ReactAppProps, typeof defaultOptions> |
Returns:
Adapt.AdaptElement<Adapt.AnyProps>
Remarks
To use this component, the srcDir
prop must be the path to the root of a ReactJS project, which contains a package.json file. The component will build a Docker container image by:
starting with an official Node.js base image
copying
srcDir
into the container imageexecuting
yarn run build
It will then copy the resulting build
directory into an http.HttpServer component.
Abstract components:
This component uses the following abstract components (via http.HttpServer)which must be replaced via style sheet rules:
The NetworkService and Container components are both children of the Service component.
Instance methods:
- hostname(): string | undefined
Returns the hostname of the NetworkService, once it is known.
- port(): number | undefined
Returns the port number of the NetworkService, once it is known.