@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
30 lines (19 loc) • 1.32 kB
Markdown
---
lang: en
title: 'API docs: core.application.state'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/core
permalink: /doc/en/lb4/apidocs.core.application.state.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/core](./core.md) > [Application](./core.application.md) > [state](./core.application.state.md)
## Application.state property
Get the state of the application. The initial state is `created` and it can transition as follows by `start` and `stop`<!-- -->:
1. start - !started -<!-- -->> starting -<!-- -->> started - started -<!-- -->> started (no-op) 2. stop - (started \| initialized) -<!-- -->> stopping -<!-- -->> stopped - ! (started \|\| initialized) -<!-- -->> stopped (no-op)
Two types of states are expected: - stable, such as `started` and `stopped` - in process, such as `booting` and `starting`
Operations such as `start` and `stop` can only be called at a stable state. The logic should immediately set the state to a new one indicating work in process, such as `starting` and `stopping`<!-- -->.
<b>Signature:</b>
```typescript
get state(): string;
```