mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
25 lines
693 B
JavaScript
25 lines
693 B
JavaScript
'use strict';
|
|
|
|
const _ = require('lodash');
|
|
|
|
function getLocalEmulatorFunctionConfig(functionConfig, providerConfig, servicePath) {
|
|
const envVars = _.merge(providerConfig.environment, functionConfig.environment);
|
|
|
|
const localEmulatorFunctionConfig = {
|
|
provider: providerConfig.name,
|
|
handler: functionConfig.handler,
|
|
servicePath,
|
|
lambdaName: functionConfig.name,
|
|
runtime: functionConfig.runtime || providerConfig.runtime,
|
|
memorySize: Number(functionConfig.memorySize)
|
|
|| Number(providerConfig.memorySize)
|
|
|| 1024,
|
|
region: providerConfig.region,
|
|
envVars,
|
|
};
|
|
|
|
return localEmulatorFunctionConfig;
|
|
}
|
|
|
|
module.exports = getLocalEmulatorFunctionConfig;
|