You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jscomp/bsb/bsb_templates.ml
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -921,8 +921,6 @@ let root = OCamlRes.Res.([
921
921
\n\
922
922
**How come we don't need any bundler during development**? We highly encourage you to open up `index.html` to check for yourself!\n\
923
923
\n\
924
-
If you start handling routes via `ReasonReactRouter` change the server script in package.json to `moduleserve ./ --port 8000 --spa` to make sure your routes don't result in a 404 not found error. With the added `--spa` flag your routes will return the index.html on page load and you can handle them client-side.\n\
925
-
\n\
926
924
# Features Used\n\
927
925
\n\
928
926
| | Blinking Greeting | Reducer from ReactJS Docs | Fetch Dog Pictures | Reason Using JS Using Reason |\n\
@@ -954,6 +952,12 @@ let root = OCamlRes.Res.([
954
952
./node_modules/.bin/webpack\n\
955
953
open indexProduction.html\n\
956
954
```\n\
955
+
\n\
956
+
# Handle Routing Yourself\n\
957
+
\n\
958
+
To serve the files, this template uses a minimal dependency called `moduleserve`. A URL such as `localhost:8000/scores/john` resolves to the file `scores/john.html`. If you'd like to override this and handle URL resolution yourself, change the `server` command in `package.json` from `moduleserve ./ --port 8000` to `moduleserve ./ --port 8000 --spa` (for \"single page application\"). This will make `moduleserve` serve the default `index.html` for any URL. Since `index.html` loads `Index.bs.js`, you can grab hold of the URL in the corresponding `Index.re` and do whatever you want.\n\
959
+
\n\
960
+
By the way, ReasonReact comes with a small [router](https://reasonml.github.io/reason-react/docs/en/router) you might be interested in.\n\
0 commit comments