Publish a react app through Domino

vaibhav.dhawanvaibhav.dhawan Administrator Posts: 4 admin
edited August 2019 in How-To Guides

This example uses the "Create React App" package:

The objective here is to make sure the app knows the base domain/subdirectory so that resources are referenced correctly. Application domains are dynamic since they include the run ID, so this must be set at runtime. Here is a sample file that will accomplish this, assuming you have already run create react app to create a new project called 'testing' in your project:

# Modify base url for your deployment (, user (test_user), project (react_app)

# change to point to directory with create-react-app project
cd testing

# Set hostname to the base url for the app in package.json
sed "4i  \"homepage\": \"$URL_BASE$DOMINO_RUN_ID\"," package.json -i

npm run build

serve -s build -l 8888

Note that you will need a compute environment with the correct packages (npm/yarn , create react, serve) installed in order to support this



Sign In or Register to comment.