Skip to content

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).

  1. 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.
  2. Reconfigure React to use HashRouter instead of BrowserRouter.
  3. Make sure that all links have %PUBLIC_URL% prefix (e.g. for favicon.ico it's ).
  4. Execute npm run build (or whatever build process you use).
  5. Rename build folder to mydominoreact and copy to the keepweb.d folder on your Domino server. To avoid the rename step, you can alter your build script to directly build into mydominoreact by adding to the .env file the entry BUILD_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.