mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
20 lines
517 B
JavaScript
20 lines
517 B
JavaScript
'use strict';
|
|
|
|
const fetch = require('node-fetch');
|
|
|
|
function deployFunctionToLocalEmulator(serviceName, functionName, config, localEmulatorRootUrl) {
|
|
const localEmulatorDeployEndpoint = `${localEmulatorRootUrl}/v0/emulator/api/deploy/${
|
|
serviceName}/${functionName}`;
|
|
|
|
return fetch(localEmulatorDeployEndpoint, {
|
|
headers: {
|
|
'content-type': 'application/json',
|
|
},
|
|
method: 'POST',
|
|
timeout: 10000,
|
|
body: JSON.stringify(config),
|
|
});
|
|
}
|
|
|
|
module.exports = deployFunctionToLocalEmulator;
|