0
votes

I am working on a project for work trying to debug an aws serverless repo and there is a lot of input to include from the POST method from the angularjs web app UI.

I can already run both locally separately but would like to have the angularjs web app point to the "local" serverless nodejs app rather than the one hosted on amazon.

One of the developers said you can replace the link in the angularjs web app which currently points to the aws nodejs serverless and change it to which would look someething like this in a json file

"pricingApiUrl": "sls/5000/",

This is so that it points to my local serverless rather than to the one on amazon so I can debug it

I was thinking maybe attaching as a process might work but don't really know how to do that.

anyway, the method above which is replacing the amazon aws serverless link for the "sls" one doesn't work either. It isn't hitting the local serverless nodejs app when I have it running.

It seems the only way I have to debug it is using Rest Client extension in Chrome or Postman. I would rather just run it in the angularjs UI web app and have it be stopped by the local serverless nodejs app at the breakpoints so I know all of the information is being passed for the POST calls.

I know this is harder to setup but I think ultimately easier for debugging

thanks

1
You say you can run both locally. On what port can you run your serverless app?Noel Llevares

1 Answers

3
votes

When you are developing severless projects locally, there are several tools you can leverage to improve the productivity.

  • Serverless Framework Plugins: You can use several plugins such as Serverlesss Offline, Serverless DynamoDB Local to emulate your project locally.
  • When you have full stack running locally specially the angular frontend and serverless API, you can use a NodeJS proxy to route the traffic with relative paths also maintaining the same origin. Some of these proxies also provides live reload to speedup the frontend development. e.g Gulp Server Livereload

We have shared solutions to similar issues as listed below, which contains development setup to emulate Web Frontend, Serverless API Gateway, Lambda and DynamoDB locally with automation using Gulp.

e.g