简体   繁体   English

如何使用 node cli 命令启动 Nest.js 应用程序?

[英]How to start Nest.js application by using node cli command?

I has been developing a Nest.js application for a REST API server, and I want to do some performance analysis by using Node.js profling tools.我一直在为 REST API 服务器开发 Nest.js 应用程序,我想通过使用 Node.js 分析工具进行一些性能分析。 I know that there are several tools like WebStorm V8 CPU and Memory Profiling ( https://www.jetbrains.com/help/webstorm/v8-cpu-and-memory-profiling.html#node_profiling_before_you_start ) and node cli option --prof .我知道有几种工具,如 WebStorm V8 CPU 和--prof分析( https://www.jetbrains.com/help/webstorm/v8-cpu-and-memory-profiling.html#node_profiling_before_you_start )和节点.

However, I don't know how to start my Nest.js application by using node cli program, so I don't know how to apply these profiling tools to my Nest.js application.但是,我不知道如何使用node cli 程序启动我的 Nest.js 应用程序,所以我不知道如何将这些分析工具应用到我的 Nest.js 应用程序中。

Is there any way to use Node.js profling tools to Nest.js application?有什么方法可以将 Node.js 分析工具用于 Nest.js 应用程序? or is there any other good solutions for Nest.js application?或者对于 Nest.js 应用程序还有其他好的解决方案吗?

Thanks in advance.提前致谢。

You could build the application using nest build and then run it using node --prof dist/main .您可以使用nest build构建应用程序,然后使用node --prof dist/main运行它。 Or you could just use nest start --watch -e 'node --prof' which should tell Nest to use node --prof dist/main for the start command或者你可以使用nest start --watch -e 'node --prof'这应该告诉 Nest 使用node --prof dist/main作为启动命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM