UNPKG

851 BPlain TextView Raw
1// Copyright IBM Corp. and LoopBack contributors 2017,2020. All Rights Reserved.
2// Node module: @loopback/core
3// This file is licensed under the MIT License.
4// License text available at https://opensource.org/licenses/MIT
5
6import {LifeCycleObserver} from './lifecycle';
7
8/**
9 * Defines the requirements to implement a Server for LoopBack applications:
10 * start() : Promise<void>
11 * stop() : Promise<void>
12 * It is recommended that each Server implementation creates its own child
13 * Context, which inherits from the parent Application context. This way,
14 * any Server-specific bindings will remain local to the Server instance,
15 * and will avoid polluting its parent module scope.
16 */
17export interface Server extends LifeCycleObserver {
18 /**
19 * Tells whether the server is listening for connections or not
20 */
21 readonly listening: boolean;
22}