Request provider in Nestjs, I cannot import REQUEST object

时间:2019-04-08 13:05:30

标签: node.js typescript dependency-injection nodes nestjs

I am trying to implement a functionality with some request providers, I am following this example in the doc https://docs.nestjs.com/fundamentals/injection-scopes#request-provider

import { Injectable, Scope, Inject } from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
import { Request } from 'express';

@Injectable({ scope: Scope.REQUEST })
export class CatsService {
  constructor(@Inject(REQUEST) private readonly request: Request) {}
}

However, I cannot import the REQUEST object. It seems like it does not exist in the core of library

Does anyone know where is it?

Error import REQUEST

These are my dependencies

"dependencies": {
    "@nestjs/common": "^6.0.5",
    "@nestjs/core": "^6.0.5",

enter image description here

Thanks

0 个答案:

没有答案