Reputation: 1
I am using AWS Lambda function with serverless and express framework in nodejs. I have pushed my node_modules to aws layers to provide the modules to lambda functions.
Issue : In AWS layers modules are accessible at path "/opt/nodejs/node_modules/" while in local we can access access all the installed modules directly. how can i define this path conditionally so that it can be accessed at both place without any code changes ??
Approach I thought : i thought to use enviornment variable for defining the enviornment prod/dev but dotenv itself needed to be imported from node_modules so i am stucked...
Approach I thought : i thought to use enviornment variable for defining the enviornment prod/dev but dotenv itself needed to be imported from node_modules so i am stucked...
Upvotes: 0
Views: 32