16
28%
BSD-2-Clause
neglectedBuckleScript interface to express-promise-router

bs-promise-router

A BuckleScript interface to express-promise-router.

Example

  • RE
  • ML
let heartbeat = (_, res: Express.Response.t) => {
  Express.Response.sendString(res, "ok") |> ignore;
  Js.Promise.resolve(Js.undefined)
};

let router = PromiseRouter.make();

PromiseRouter.get(router, ~path="/", heartbeat);

Express.App.use(app, asMiddleware(router));
let heartbeat _ (res : Express.Response.t) =
  (Express.Response.sendString res "ok") |> ignore;
  Js.Promise.resolve Js.undefined
let router = PromiseRouter.make ()
let _ = PromiseRouter.get router ~path:"/" heartbeat
let _ = Express.App.use app (asMiddleware router)