bs-promise-router
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "bs-promise-router", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "BuckleScript interface to express-promise-router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,5 +8,12 @@ # bs-promise-router | ||
```reason | ||
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="/", HttpUtils.heartbeat); | ||
PromiseRouter.get(router, ~path="/", heartbeat); | ||
Express.App.use(app, asMiddleware(router)); | ||
``` |
45868
19