ReactJS
The Domino REST API allows to host SPA in its keepweb.d
directory. This page will highlight the steps to make this work with ReactJS.
This is not a ReactJS tutorial
When you are not familiar with ReactJS, this is not the place for you. Rather, learn open standards, but if you insist:
Prerequisites
-
You are familiar with ReactJS
-
NodeJS and ReactJs CLI installed
Steps
In the steps below, the name of the application (and thus the folder name) will be mydominoreact
. Each application needs its own name, so replace mydominoreact
with the name of your choice. Following web conventions, use lowercase characters and nothing special in the name (especially no spaces or slashes in any direction).
-
To ensure proper path resolution, you need to add
PUBLIC_URL=/keepweb/mypromydominoreactject
parameter to.env
file.Note
keepweb
can be something else in your configuration. -
Reconfigure React to use HashRouter instead of BrowserRouter.
-
Make sure that all links have %PUBLIC_URL% prefix (e.g. for favicon.ico it's ).
- Execute
npm run build
(or whatever build process you use). - Rename
build
folder tomydominoreact
and copy to thekeepweb.d
folder on your Domino server. To avoid the rename step, you can alter your build script to directly build intomydominoreact
by adding to the.env
file the entryBUILD_PATH='./mydominoreact'
.
Let's connect
We really like to hear from you!
Your opinion matters. Let us know all your:
- questions
- discussions
- ideas
- feedback
Join the OpenNTF Discord channel.