now-fts

<a href="https://github.com/transitive-bullshit/functional-typescript" title="Functional TypeScript"> <img src="https://raw.githubusercontent.com/transitive-bullshit/functional-typescript/master/logo.png" alt="FTS Logo" width="150" /> </a>

Usage no npm install needed!

<script type="module">
  import nowFts from 'https://cdn.skypack.dev/now-fts';
</script>

README

FTS Logo

now-fts

@zeit/now builder for Functional TypeScript.

NPM Build Status JavaScript Style Guide

The main benefit of now-fts is that you just write TypeScript functions and can easily deploy robust serverless functions. No dealing with HTTP, parameter validation, or data encoding / decoding!

See the main docs for info on FTS in general.

Usage

Say we have the following FTS function:

// example.ts
export function example(name: string, foo: number): string {
  return `${name}: ${foo}`
}

You can use the now-fts builder to deploy it as an HTTP lambda with the following now.json:

// now.json
{
  "version": 2,
  "builds": [{ "src": "example.ts", "use": "now-fts" }]
}

Then deploy the application via the now command.

The resulting deployment will use an fts-http handler to respond to HTTP requests by invoking the original example function, without you having to deal with HTTP, server logic, parameter checking, or data encoding / decoding.

License

MIT © Saasify