A basic server example using Opium built with ReasonML.
Clone this repository and cd
into it.
npm i -g esy@latest
esy
esy start
Server runs by default at http://localhost:3000
See src/server.re
for available endpoints.
File | Description |
---|---|
esy.json | If you're used to a NPM-like worfklow, esy.json is your package.json and specifies all dependencies and scripts. |
*/dune | The build system. Specify dependencies and more. Docs. |
src/logging.re | Sets up our logging. Grabbed from https://github.com/rgrinberg/opium/blob/master/examples/hello_world_log.ml. |
src/server.re | Our main executable (dune). |
- Opium (OCaml) - ExpressJS-like web-toolkit.
- Refmterr (ReasonML) - Pretty printing for error-messages
- Tablecloth (Reasonml/OCaml) - One of a few base-libraries
- Cohttp (OCaml) - Used by Opium for underlying HTTP-implementation.
- Lwt (OCaml) - A promise-implementation for Native OCaml/ReasonML. The
ppx
is used forawait
-like syntax.