Aug 25, 2017 · 1 min read
Thanks David, this got me started.
I had trouble getting this to run on windows, and solved it by pulling the entire thing into vscode instead of launching an npm package.
This is with serverless installed locally, Here’s my setup in the launch.json file:
{
"type": "node",
"request": "launch",
"name": "Launch Serverless Offline",
"program": "${workspaceRoot}/server/node_modules/serverless/bin/serverless",
"args": [
"offline",
"start"
],
"cwd": "${workspaceRoot}/server",
"env": {
"SLS_DEBUG": "*"
}
}This launches into debug mode directly. The env section will set the SLS_DEBUG var. I put my code in a /server subdirectory as I also have a /client subdirectory. You won’t need the cwd line and the /server/ part in the “program” line if you aren’t using a subdirectory.