nestjs vs plain express performance

UPDATE – 17.03.2020 We are now running benchmarks for every new PR. One of the latest benchmarks can be found here: https://github.com/nestjs/nest/runs/482105333 Req/sec Trans/sec Nest-Express 15370 3.17MB Nest-Fastify 30001 4.38MB Express 17208 3.53MB Fastify 33578 4.87MB That means Nest + FastifyAdapter is now almost 2 times faster than express. UPDATE – 22.09.2018 Benchmarks directory has … Read more

What’s the difference between Interceptor vs Middleware vs Filter in Nest.js?

As you already implied with your question, all three are very similar concepts and in a lot of cases it is hard to decide and comes down to your preferences. But I can give an overview of the differences: Interceptors Interceptors have access to response/request before and after the route handler is called. Registration Directly … Read more

TypeORM Entity in NESTJS – Cannot use import statement outside a module

My assumption is that you have a TypeormModule configuration with an entities property that looks like this: entities: [‘src/**/*.entity.{ts,js}’] or like entities: [‘../**/*.entity.{ts,js}’] The error you are getting is because you are attempting to import a ts file in a js context. So long as you aren’t using webpack you can use this instead so … Read more

Inject nestjs service from another module

You have to export the ItemsService in the module that provides it: @Module({ controllers: [ItemsController], providers: [ItemsService], exports: [ItemsService] ^^^^^^^^^^^^^^^^^^^^^^^ }) export class ItemsModule {} and then import the exporting module in the module that uses the service: @Module({ controllers: [PlayersController], providers: [PlayersService], imports: [ItemsModule] ^^^^^^^^^^^^^^^^^^^^^^ }) export class PlayersModule {} ⚠️ Don’t add the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)