Lesson 4: Test the Worker
Run this command:
Copied to your clipboard$> aio app run
After a few seconds it will open Asset Compute Devtool in your browser. Within that tool, you can test your worker without the AEM.
Since our worker requires imgix
parameter (as seen at line 34 in the worker code), you need to provide it in the worker request object as shown on the screenshot. That parameter must be an escaped JSON. For instance, use this parameter to resize an image to 300x300px:
Copied to your clipboard"imgix": "{ \"h\": 300, \"w\": 300}"
Then run your worker and observe results on the right side of the Asset Compute Devtool.
To let AEM use our worker, deploy the app by running:
Copied to your clipboard$> aio app deploy
The command, will return the URL of your worker, similar to the below. Write it down, so we can put it in the AEM configuration.
Copied to your clipboardYour deployed actions:-> dx-asset-compute-worker-1/__secured_my-worker-> https://99999-myassetcompute-dev.adobeioruntime.net/api/v1/web/dx-asset-compute-worker-1/my-workerWell done, your app is now online 🏄