无法使用无服务器中的WebStorm中调试Node.js应用程序
我目前正在node.js创建lambda函数,并希望在本地调试代码。我正在使用webstorm作为我的IDE。
serverless.yml中
service: applicationsync
frameworkVersion: '3'
provider:
name: aws
runtime: nodejs12.x
plugins:
- serverless-offline
functions:
hello:
handler: index.handler
events:
- http:
path: hello
method: get
- http:
path: hello
在我的package.json中的
{
"name": "applicationsync",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "./node_modules/.bin/serverless offline -s dev",
"debug": "set SLS_DEBUG=* && node --inspect /usr/lib/node_modules/serverless/bin/serverless offline -s dev"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"serverless-offline": "^8.8.0"
},
"dependencies": {
"aws-sdk": "^2.1170.0",
"mysql": "^2.18.1"
}
}
,然后我添加了一些屏幕截图。
我单击调试选项:
以下运行:
我的文件结构:
当我发送请求时,我会收回响应,但忽略了断点,并且没有触发调试。
我想知道我缺少什么。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您应该尝试
编辑配置...
并定期运行...
应用程序。Maybe you should try to
Edit Configurations...
and regularlyRun...
the app.