Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
fix: layer wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
echosoar committed Dec 11, 2019
1 parent 6a3cc02 commit acfecf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const wrapperContent = `const { FaaSStarter } = require('@midwayjs/faas');
const { asyncWrapper, start } = require('@midwayjs/serverless-fc-starter');
<% layerDeps.forEach(function(layer){ %>const <%=layer.name%> = require('<%=layer.path%>').default;
<% layerDeps.forEach(function(layer){ %>const <%=layer.name%> = require('<%=layer.path%>');
<% }); %>
let starter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
export const wrapperContent = `const { FaaSStarter } = require('@midwayjs/faas');
const { asyncWrapper, start } = require('@midwayjs/serverless-scf-starter');
<% layerDeps.forEach(function(layer){ %>const <%=layer.name%> = require('<%=layer.path%>');
<% }); %>
let starter;
let runtime;
let inited = false;
const initializeMethod = async (config = {}) => {
runtime = await start();
runtime = await start({
layers: [<%= layers.join(", ") %>]
});
starter = new FaaSStarter({ config, baseDir: __dirname });
await starter.start();
inited = true;
Expand Down

0 comments on commit acfecf8

Please sign in to comment.