• Version 8.2.6
  • Published
  • 49.4 kB
  • 5 dependencies
  • MIT license


npm i @nestjs/platform-express
yarn add @nestjs/platform-express
pnpm add @nestjs/platform-express


Nest - modern, fast, powerful node.js web framework (@platform-express)



function AnyFilesInterceptor

AnyFilesInterceptor: (localOptions?: MulterOptions) => Type<NestInterceptor>;

    function FileFieldsInterceptor

    FileFieldsInterceptor: (
    uploadFields: MulterField[],
    localOptions?: MulterOptions
    ) => Type<NestInterceptor>;

      function FileInterceptor

      FileInterceptor: (
      fieldName: string,
      localOptions?: MulterOptions
      ) => Type<NestInterceptor>;

        function FilesInterceptor

        FilesInterceptor: (
        fieldName: string,
        maxCount?: number,
        localOptions?: MulterOptions
        ) => Type<NestInterceptor>;


          class ExpressAdapter

          class ExpressAdapter extends AbstractHttpAdapter {}


            constructor(instance?: any);

              method applyVersionFilter

              applyVersionFilter: (
              handler: Function,
              version: VersionValue,
              versioningOptions: VersioningOptions
              ) => <TRequest extends Record<string, any> = any, TResponse = any>(
              req: TRequest,
              res: TResponse,
              next: () => void
              ) => any;

                method close

                close: () => Promise<unknown>;

                  method createMiddlewareFactory

                  createMiddlewareFactory: (
                  requestMethod: RequestMethod
                  ) => (path: string, callback: Function) => any;

                    method disable

                    disable: (...args: any[]) => any;

                      method enable

                      enable: (...args: any[]) => any;

                        method enableCors

                        enableCors: (options: CorsOptions | CorsOptionsDelegate<any>) => any;

                          method engine

                          engine: (...args: any[]) => any;

                            method getRequestHostname

                            getRequestHostname: (request: any) => string;

                              method getRequestMethod

                              getRequestMethod: (request: any) => string;

                                method getRequestUrl

                                getRequestUrl: (request: any) => string;

                                  method getType

                                  getType: () => string;

                                    method initHttpServer

                                    initHttpServer: (options: NestApplicationOptions) => void;

                                      method listen

                                      listen: {
                                      (port: string | number, callback?: () => void): any;
                                      (port: string | number, hostname: string, callback?: () => void): any;

                                        method redirect

                                        redirect: (response: any, statusCode: number, url: string) => any;

                                          method registerParserMiddleware

                                          registerParserMiddleware: () => void;

                                            method render

                                            render: (response: any, view: string, options: any) => any;

                                              method reply

                                              reply: (response: any, body: any, statusCode?: number) => any;

                                                method set

                                                set: (...args: any[]) => any;

                                                  method setBaseViewsDir

                                                  setBaseViewsDir: (path: string | string[]) => any;

                                                    method setErrorHandler

                                                    setErrorHandler: (handler: Function, prefix?: string) => any;

                                                      method setHeader

                                                      setHeader: (response: any, name: string, value: string) => any;

                                                        method setLocal

                                                        setLocal: (key: string, value: any) => this;

                                                          method setNotFoundHandler

                                                          setNotFoundHandler: (handler: Function, prefix?: string) => any;

                                                            method setViewEngine

                                                            setViewEngine: (engine: string) => any;

                                                              method status

                                                              status: (response: any, statusCode: number) => any;

                                                                method useStaticAssets

                                                                useStaticAssets: (path: string, options: ServeStaticOptions) => any;

                                                                  class MulterModule

                                                                  class MulterModule {}

                                                                    method register

                                                                    static register: (options?: MulterModuleOptions) => DynamicModule;

                                                                      method registerAsync

                                                                      static registerAsync: (options: MulterModuleAsyncOptions) => DynamicModule;


                                                                        interface MulterModuleAsyncOptions

                                                                        interface MulterModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {}

                                                                          property inject

                                                                          inject?: any[];

                                                                            property useClass

                                                                            useClass?: Type<MulterOptionsFactory>;

                                                                              property useExisting

                                                                              useExisting?: Type<MulterOptionsFactory>;

                                                                                property useFactory

                                                                                useFactory?: (
                                                                                ...args: any[]
                                                                                ) => Promise<MulterModuleOptions> | MulterModuleOptions;

                                                                                  interface MulterOptionsFactory

                                                                                  interface MulterOptionsFactory {}

                                                                                    method createMulterOptions

                                                                                    createMulterOptions: () => Promise<MulterModuleOptions> | MulterModuleOptions;

                                                                                      interface NestExpressApplication

                                                                                      interface NestExpressApplication extends INestApplication {}
                                                                                      • Interface describing methods on NestExpressApplication.

                                                                                        See Also

                                                                                        • [Platform](https://docs.nestjs.com/first-steps#platform)

                                                                                      method disable

                                                                                      disable: (...args: any[]) => this;
                                                                                      • A wrapper function around native express.disable() method.



                                                                                        Example 1


                                                                                      method enable

                                                                                      enable: (...args: any[]) => this;
                                                                                      • A wrapper function around native express.enable() method.



                                                                                        Example 1


                                                                                      method engine

                                                                                      engine: (...args: any[]) => this;
                                                                                      • A wrapper function around native express.engine() method.



                                                                                        Example 1

                                                                                        app.engine('mustache', mustacheExpress())

                                                                                      method set

                                                                                      set: (...args: any[]) => this;
                                                                                      • A wrapper function around native express.set() method.



                                                                                        Example 1

                                                                                        app.set('trust proxy', 'loopback')

                                                                                      method setBaseViewsDir

                                                                                      setBaseViewsDir: (path: string | string[]) => this;
                                                                                      • Sets one or multiple base directories for templates (views).



                                                                                        Example 1


                                                                                      method setLocal

                                                                                      setLocal: (key: string, value: any) => this;
                                                                                      • Sets app-level globals for view templates.



                                                                                        Example 1

                                                                                        app.setLocal('title', 'My Site')

                                                                                        See Also

                                                                                        • https://expressjs.com/en/4x/api.html#app.locals

                                                                                      method setViewEngine

                                                                                      setViewEngine: (engine: string) => this;
                                                                                      • Sets a view engine for templates (views).



                                                                                        Example 1


                                                                                      method useStaticAssets

                                                                                      useStaticAssets: {
                                                                                      (options: ServeStaticOptions): this;
                                                                                      (path: string, options?: ServeStaticOptions): this;
                                                                                      • Sets a base directory for public assets.



                                                                                        Example 1


                                                                                      Type Aliases

                                                                                      type MulterModuleOptions

                                                                                      type MulterModuleOptions = MulterOptions;

                                                                                        Package Files (9)

                                                                                        Dependencies (5)

                                                                                        Dev Dependencies (2)

                                                                                        Peer Dependencies (2)


                                                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@nestjs/platform-express.

                                                                                        • Markdown
                                                                                        • HTML
                                                                                          <a href="https://www.jsdocs.io/package/@nestjs/platform-express"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>