Skip to content
The missing Micro builder for Now 2.0
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test chore: added then-sleep to sample-project dependencies Jan 4, 2019
.eslintrc
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md docs: added micro dependency mention Jan 4, 2019
builder.js fix: syntax error on builded code Jan 4, 2019
package.json test: added async lambda tests Jan 4, 2019
yarn.lock test: added async lambda tests Jan 4, 2019

README.md

Now Micro

Build Status coverage npm version

Proper Micro builder for Now 2.0

Purpose

As of now, @now/node lambdas resemble a lot a Micro environment, but it is just not that, which causes quite a lot of unexpected results.

Installation

yarn add now-micro micro

Gotcha: so far we found no way to inject micro dependency during the build process, so it MUST be a dependency of your lambda, thus why we added it to the above command ;)

Usage

Use now-micro in your builders on now.json:

{
  "version": 2,
  "builds": [{ "src": "file.js", "use": "now-micro" }]
}

Develop your lambdas as a fully Micro compatible function:

// ex. showing async usage and value returning (no res.end):
module.exports = async req => Promise.resolve(`Some result`)
You can’t perform that action at this time.