To test the end-to-end integration of API & Mailchimp you should deploy to preview and point your demo/preview Solomon app to the preview stories api.
- On your WIP branch find and replace
solomon-v3-stories:latest
inpackage.json
withsolomon-v3-stories:preview
& save the file. - When you're ready to test run
npm run dockerBuildAndDeploy
- Change the
config
for the app you're going to test e.g.solomon-v3-demo
- update
solomonStoriesApi.host
tohttps://solomon-v3-stories-preview.azurewebsites.net/api
- make sure
modules.mailchimp.enabled: true
- update
- restart the preview api on azure portal & test using your preview site
It is VERY difficult to test locally. As well as the incomplete steps below, the redirect url in the mailchimp account where the application is registered (Main Solomon) needs to exactly match the redirect url passed (ngrok in this case) You also need to make sure you're mapping/forcing the correct host database & config database
run ngrok forwarding port 3000
cd FOLDER_CONTAINING_NGROK
./ngrok http 3000
take the resulting http address and enter it into your local solomon-v3-ui
environment file under APP.solomonConfig.apis.solomonStoriesApi.host
e.g.
solomonStoriesApi: {
host: 'https://c4f8-81-104-239-27.ngrok.io/api'
}
- Make sure
.env
in this stories api repo has theHOSTNAME_OVERRIDE
set e.g.HOSTNAME_OVERRIDE=v3.mysolomon.co.uk
matches V3 api server used insolomonApi
inv3-ui
environment.js
e.g.
apis: {
solomonApi: {
host: 'https://solomon-v3-api-demo.azurewebsites.net'
}
}
- in
.env
make sure to use a testing mailchimp app's client id & secret. If you were to try test locally using the live main solomon mailchimp app's credentials you would have to edit that to redirect to your ngrok address - affecting all live use. So you need to create a testing app. We have one under the development account for nathan@mysolomon.co.uk.
Go to the testing mailchimp account's app settings and enter the Redirect Uri to your newly created ngrok address plus /api/mailchimp/callback
e.g. http://1b8d-188-28-168-239.ngrok.io/api/mailchimp/callback
In stories api /env
file set MAILCHIMP_REDIRECT_URL
to the same ngrok address as you used in the previous step on the mailchimp app settings http://1b8d-188-28-168-239.ngrok.io/api/mailchimp/callback
Make sure to enable mailchimp module in your locally served ui app...
modules: {
mailchimp: {
enabled: true,
}
}
...in the environment.js
ember s
from local v3-ui