How to use the @serverless/template.constructor function in @serverless/template

To help you get started, we’ve selected a few @serverless/template examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / components / __microservice / serverless.js View on Github external
async default(inputs = {}) {
        const cwd = process.cwd();
        const rootFolder = path.resolve(inputs.path);
        process.chdir(rootFolder);
        inputs.template = path.join(rootFolder, "serverless.yml");

        const config = {
            root: rootFolder,
            stateRoot: path.join(rootFolder, ".serverless"),
            debug: inputs.debug,
            entity: Template.constructor.name
        };

        const context = new Context(config);
        const component = new Template(undefined, context);
        await component.init();

        const output = await component(inputs);
        process.chdir(cwd);
        return output;
    }

@serverless/template

This component is used behind the scenes to deploy your YAML templates. It is loaded by the serverless CLI and executed just as any other component. However, there's a lot you can do with this component programmatically. See the sections below for some ex

Apache-2.0
Latest version published 4 years ago

Package Health Score

42 / 100
Full package analysis

Popular @serverless/template functions

Similar packages