How to debug aws lambda functions written in node js

后端 未结 9 3244
孤城傲影
孤城傲影 2021-02-20 13:34

We have been developing AWS Lambda functions in Node JS for a few months. Can we debug, i.e. step through the Node JS code as we can with .Net C# code in Visual Studio?

9条回答
  •  臣服心动
    2021-02-20 14:12

    Trek 10 released an interesting tool recently that allows stepping through node.js code live in AWS lambda functions! How, you may ask? "Magic and mirrors", according to them :-)

    Apparently, it doesn't attach to Amazon's host process directly (which is impossible), but it forks your code into a child process running in debug mode and proxies connections to your local Chrome DevTools. (There is actually a little more to the configuration, which you can read about at the github repo below.)

    Here's the announcement: https://www.trek10.com/blog/aws-lambda-debugger/

    and the github repo: https://github.com/trek10inc/aws-lambda-debugger

提交回复
热议问题