Power up serverless framework with javascript configurations

Pavel Vlasov
2 min readJan 30, 2018

Building a larger project with serverless framework forces you to break your application into many services. But, yaml and json configurations are not always flexible enough to cover all the needs. Fortunately, 1.26 release will change it all with support of serverless.js files.

Inheritance

There’re bunch of commonly used chunks of configuration copied from one file to another. Now you can easily extend base file or use default settings:

I used lodash merge to extend base-serverless.js.

Composition

Serverless has a mechanism to include settings from external files. But it doesn’t allow you to generate it dynamically or include custom logic. With serverless.js you can use external modules, that’s slightly more flexible:

--

--