Replace the backendUrl variable for the corresponding backend server URL.
Don't forget the/api suffix.
Replace the frontend.host for your custom domain.
// Place the URL here with the /api suffix.// Ex.:`https://domain.com/api`;constbackendUrl=`https://your_production_backend_url/api`;constfrontendUrl={host:'scaffoldhub-demo.xyz',protocol:'https',};
Add the server files to your project
Heroku does not have a way of hosting static files, so we must set an ExpressJS server to serve our static files.
frontend/Procfile
frontend/server.js
Replace Line 5 with the one for the corresponding front-end framework you are using.
The server.js needs express and express-history-api-fallback.
Heroku starts the application by running npm start, so you must change the start script to run the ExpressJS server file.
frontend/package.json
Now if you want to start the frontend, you will have to run npm run start:frontend .
After installed, run the command below, changing the YOUR_CUSTOM_DOMAIN for your domain.
Follow the instructions. You will have to create a DNS TXT record.
Before hitting next, make sure the TXT variables are configured correctly using a tool like https://mxtoolbox.com/SuperTool.aspx. Make sure you have TXT Lookup selected.
Ok, now you have your certificate saved at /etc/letsencrypt/live/your_custom_domain.