fastify-with-reason
v0.1.4
Published
Fastify bindings in Reason
Downloads
1
Maintainers
Readme
Fastify bindings for BuckleScript in ReasonML
Getting Started
Create a new project:
bsb -init server -theme basic-reason
Install fastify-with-reason using npm:
yarn add fastify-with-reason
Then add fastify-with-reason as a dependency to bsconfig.json
Example Server
Create a Server.re inside src:
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
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)
Go to Wiki for documentation (coming soon)