start #
Available since 2.8.0
This method starts the application.
Once the promise returned by this method resolved, the application is in the running phase.
start(): Promise<void>Returns #
Returns a Promise resolving when the application is running.
Errors #
- plugin.runtime.already_started: the application is already started
- Available since 2.60.0cluster.join.duplicate_ip, cluster.join.full_state_unavailable or cluster.join.timeout: the node cannot join the cluster
Available since 2.60.0
A failed startup cannot be retried: the node shuts down and the process exits with code 1. The promise still rejects with the error before the process exits, so you can log it. See A failed startup stops the node.
Usage #
try {
await app.start()
// Application is now in "running" phase
}
catch (error) {
// The node is shutting down: log the error, do not try to go on
app.log.error(error)
}