1.2.1 • Published 6 years ago

reason-simple-server v1.2.1

Weekly downloads
9
License
MIT
Repository
-
Last release
6 years ago

Reason Simple Server

This is a library for native reason (with bsb-native) that lets you stand up a simple server without too much trouble.

Basic Server

open ReasonSimpleServer.Basic.Response;

let handler = (method, path, headers) => {
  switch (method, path) {
  | ("GET", "/") => {
    Ok("text/plain", "All clear boss!")
  }
  | ("POST", _) => Bad(401, "Can't do that")
  | ("Get", "/") => Ok("text/html", "<h1>Howdy</h1>")
  }
};

ReasonSimpleServer.Basic.listen(~port=3451, handler);

There's lots of features missing, but it's very small and light.

Static Server

ReasonSimpleServer.Static.run(~port=3451, "./");
1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago