mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
feat(fastify): added description of the listen method
This commit is contained in:
@@ -7,3 +7,4 @@
|
||||
|
||||
export * from './adapters';
|
||||
export * from './interfaces';
|
||||
export * from './types';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { HTTPInjectOptions, HTTPInjectResponse } from 'fastify';
|
||||
import { NestFastifyListenCallback } from '../types/nest-fastify-listen-callback.type';
|
||||
|
||||
export interface NestFastifyApplication extends INestApplication {
|
||||
/**
|
||||
@@ -35,4 +36,21 @@ export interface NestFastifyApplication extends INestApplication {
|
||||
* @returns {void}
|
||||
*/
|
||||
inject(opts: HTTPInjectOptions | string): Promise<HTTPInjectResponse>;
|
||||
|
||||
/**
|
||||
* Starts the application.
|
||||
* @returns A Promise that, when resolved, is a reference to the underlying HttpServer.
|
||||
*/
|
||||
listen(port: number, callback: NestFastifyListenCallback): Promise<any>;
|
||||
listen(
|
||||
port: number,
|
||||
address: string,
|
||||
callback: NestFastifyListenCallback,
|
||||
): Promise<any>;
|
||||
listen(
|
||||
port: number,
|
||||
address: string,
|
||||
backlog: number,
|
||||
callback: NestFastifyListenCallback,
|
||||
): Promise<any>;
|
||||
}
|
||||
|
||||
1
packages/platform-fastify/types/index.ts
Normal file
1
packages/platform-fastify/types/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './nest-fastify-listen-callback.type';
|
||||
@@ -0,0 +1 @@
|
||||
export type NestFastifyListenCallback = (err: Error, address: string) => void;
|
||||
Reference in New Issue
Block a user