now-static-bin

0.2.4 • Public • Published

now-static-bin

This package provides a builder for Zeit's Now 2.0 offering that enables running arbitrary executables in the generated lambdas.

Usage

Your now.json "builds" section should look something like this:

Example

Note: don't forget to add "version": 2 in your now.json file to use Now 2.0 explicitly.

{
  "builds": [
    {
      "src": "*.exe",
      "use": "now-static-bin",
      "config": {
        "port": 4000
      }
    }
  ]
}

Other Examples

Make sure to check the examples folder in this repo for examples in different programming languages. Below is a table that details their implementation choices.

They are also deployed on every commit to master and the latest build lives in now-static-bin-examples.now.sh.

Example Demo Description
OCaml https://now-static-bin-examples.now.sh/examples/bintry/main.exe An OCaml static binary example server (no source available yet)
Rust https://now-static-bin-examples.now.sh/examples/rust/server.exe A Rust simple-server example
Reason https://now-static-bin-examples.now.sh/examples/reason/main.exe A Reason Cohttp server example that outputs request information

Configuration Options

  • port: the port that the deployed server listens on. Defaults to 8080.
  • timeout: the timeout that the launcher waits for your server to start listening on the specified port. Defaults to 50ms.

Limitations

  • Currently only HTTP servers are supported.
  • The maxLambdaSize setting defaults to 25MB. You can override this (up to a limit of 50MB) in the builder config, e.g.:
{
  "builds": [
    {
      "src": "*.exe",
      "use": "now-static-bin",
      "config": {
        "port": 4000,
        "maxLambdaSize": "50mb"
        ^^^ NEW
      }
    }
  ]
}

Copyright and License

Copyright © 2018 António Nuno Monteiro.

Distributed under the MIT License (see LICENSE).

Readme

Keywords

none

Package Sidebar

Install

npm i now-static-bin

Weekly Downloads

1

Version

0.2.4

License

MIT

Unpacked Size

6.79 MB

Total Files

8

Last publish

Collaborators

  • anmonteiro