You have created and embedded a chart, so let’s build and deploy the web application to see that everything worked.
To build and host the web application locally - recommended for sandbox use and testing
On commandline run:
npm start
Unless otherwise notified, the site will be hosted at http://localhost:3000 - you can skip the rest of this page and proceed to test your changes.
To build the web application for hosting in Realm - recommended for a more permanent instance, or repeated testing
- On commandline, run:
npm run build
When it completes, a “build” directory will be made, with the following files and “static” directory:
asset-manifest.json
index.html
logo192.png
manifest.json
precache-manifest.c369024c97162a63d34202304b2410db.js
robots.txt
service-worker.js
static
- In the Realm UI in your browser, click on “Hosting” on the left-hand side under “MANAGE”
- You should see this page:
- Upload everything inside the build folder by dragging and dropping the files and static directory. The green UPLOAD FILES button does not support uploading a directory like the “static” directory. It is OK to overwrite existing files. When complete, it should look like this:
- Run Actions/Flush CDN Cache, click “Flush Cache” when prompted.
- Make note of the URL on the Hosting page, this is your website! Paste it to the “URL” field in the template
If you have a blue bar that says:
“Your site is in the process of being created, which may take up to 15 minutes.”
then wait until that is gone before proceeding to test your changes.
- Go to your local website or the website with the URL from the template
- Login with your “App Admin username” and “App Admin password”
- If you can’t login, check:
Make suresrc/config.js
exists and fields are set - especiallyrealm-app-id
The Realm user was created in the Realm
The Realm user is in a document the wildaid.User collection and the Realm ID is correct - Your browser’s inspector console may have more information about what went wrong.
Test to make sure the chart you embedded actually works. If it is not working, there is a section on Troubleshooting Charts.
Create more charts in the next guide!