claudiajs / claudia

Deploy Node.js projects to AWS Lambda and API Gateway easily
https://claudiajs.com
MIT License
3.8k stars 274 forks source link

How to debug the application locally #218

Open aslary opened 4 years ago

aslary commented 4 years ago

After digging through the docs of Claudia and AWS, I am still not able to setup a local environment, in which I can debug the application. I am using the Claudia API Builder for the REST methods.

Claudia is great for simple deployment, but how can I debug my app locally?

I have seen this: https://claudiajs.com/tutorials/testing-locally.html, but my goal is really to analyse my program line by line with the debugger.

dmackinn commented 4 years ago

@aslary have you tried using claudia-local-api ? https://www.npmjs.com/package/claudia-local-api

You can run Claudia locally like an express app during development. Here is an npm script that I use to run mine "start-local": "nodemon --exec claudia-local-api --api-module api.js --port 2932 | bunyan --output short",

rcoundon commented 4 years ago

After digging through the docs of Claudia and AWS, I am still not able to setup a local environment, in which I can debug the application. I am using the Claudia API Builder for the REST methods.

Claudia is great for simple deployment, but how can I debug my app locally?

I have seen this: https://claudiajs.com/tutorials/testing-locally.html, but my goal is really to analyse my program line by line with the debugger.

Something else you could consider is Thundra.io - they have tools for allowing you to attach a debugger to a lambda function as it's actually running in AWS.

rcoundon commented 4 years ago

@dmackinn - have you found a way to attach a debugger to the process being run by claudia-local-api?

dmackinn commented 4 years ago

@rcoundon For local development using claudia-local-api it runs just like an express server and you can console.log anywhere in the app.

rcoundon commented 4 years ago

@dmackinn Yeah, I've used it, just haven't managed to attach a live debugger so was wondering if anyone had.