# fastify-with-reason

> Fastify bindings in Reason

Latest version **0.1.4** (published 2019-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install fastify-with-reason
pnpm add fastify-with-reason
yarn add fastify-with-reason
bun add fastify-with-reason
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2019-01-19 |
| First published | 2019-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 207.2 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Aaron Shafovaloff |
| Maintainers | acciaiodigitale |
| Keywords | BuckleScript, ReasonML, Fastify, Web, Node, Server |

## Links

- npm: https://www.npmjs.com/package/fastify-with-reason
- Repository: https://github.com/aaronshaf/reasonml-fastify
- Homepage: https://github.com/aaronshaf/reasonml-fastify#readme
- Issues: https://github.com/aaronshaf/reasonml-fastify/issues
- npm.io page: https://npm.io/package/fastify-with-reason

## Dependencies (3)

- [fastify](https://npm.io/package/fastify.md) ^1.13.4
- [bs-decode](https://npm.io/package/bs-decode.md) ^0.3.3
- [@aaronshaf/bs-js](https://npm.io/package/@aaronshaf/bs-js.md) ^1.0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2019-01-19
- 0.1.3 — 2019-01-17

## README

![Logo](https://raw.githubusercontent.com/aaronshaf/reasonml-fastify/master/Reasonfastify.png)

[Fastify](https://www.fastify.io/) bindings for [BuckleScript](https://github.com/bloomberg/bucklescript) in [ReasonML](https://reasonml.github.io/) 

![](https://img.shields.io/npm/v/fastify-with-reason.svg?style=plastic) ![](https://img.shields.io/github/license/aaronshaf/reasonml-fastify.svg?style=plastic) 

## Getting Started

Create a new project:

```Shell
bsb -init server -theme basic-reason
```

Install fastify-with-reason using npm:

```Shell
yarn add fastify-with-reason
```

Then add fastify-with-reason as a dependency to `bsconfig.json`


## Example Server

Create a Server.re inside src:

```Reason
open Fastify;

let app = createServer(~logger=true);

app->get("/", (_request, reply) => reply->send("Hello, world!"));

app->listen(3000, result =>
  switch (result) {
  | Ok(_address) => ()
  | Error(error) =>
    app->logError(error);
    Node.Process.exit(1);
  }
);
```

This server simply respond with a json "Hello, world!" on localhost:3000

```Shell
yarn build
node src/Server.bs.js
```
### A little Benchmark with Autocannon

On my iMac (2,3 GHz Intel Core i5 - 8 GB 2133 MHz DDR4)

![Benchmark](https://raw.githubusercontent.com/aaronshaf/reasonml-fastify/master/Benchmark.png)

Go to [Wiki](https://github.com/aaronshaf/reasonml-fastify/wiki) for documentation (coming soon)

---
_Source: https://npm.io/package/fastify-with-reason · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
