What is the best way to handle node_modules in a microservice architecture project using serverless framework on AWS Lambda?

时间:2019-04-08 13:11:16

标签: node.js mongoose aws-lambda serverless-framework

Here I am using this architecture, please suggest me a better one, I am new in this field.

Project structure

|models
|node_modules
|package.json
|services
    |serviceA
    |      |---handler.js
    |      |---serverless.yml
    |serviceB
    |     |---get.js
          |---delete.js
          |---serverless.yml  

1 个答案:

答案 0 :(得分:1)

You should have package.json (and node_modules) inside each service directory - it is needed because otherwise the node_modules directory will not be deployed.