Setting up Express with bs-express


#1

How would I convert this to ReasonML using bs-express? Seems simple but I’m stuck on reproducing the last line:

const App = Express();
App.use(Express.static(‘dist’));
App.use(’/*’, Express.static(‘dist/index.html’));

I want all routes to point towards the index.html file.


#2

Figured it out as soon as I posted, I forgot to insert “*”

In case another noob comes after me:

App.useOnPath(
app,
~path="/*",
{
let options = Static.defaultOptions();
Static.make("…/dist/index.html", options) |> Static.asMiddleware;
},
);