Documentation / @andrew_l/app / startApp
Function: startApp()
startApp<
P,S>(app,props):Promise<StartResult<P,S>>
Run setup and entry in one call. Shuts down automatically if entry fails.
Type Parameters
P
P extends ObjectPropsOptions<Data>
S
S extends Record<string, any>
Parameters
app
AppDefinition<P, S, { }, RuntimeContext<S & object>, EntryContext<S & object>, { app: AppInstance; log: Logger; }> | AppInstance<P, S, { }>
props
Returns
Promise<StartResult<P, S>>
Example
ts
const result = await startApp(myApp, { port: 3000 });
if (isSuccess(result)) {
await appWaitShutdown(result.app);
}