STEP-3 Accessing Magento 2 Controller, Bypassing ScandiPWA frontend
  1. 1.
    Add ScandiPWA_Route717 as a sequence to your [MODULE]/module.xml
app/code/ScandiPWA/Version/etc/module.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="ScandiPWA_Version">
<sequence>
<module name="ScandiPWA_Route717" />
</sequence>
</module>
</config>
2. Create di.xml file in [MODULE]/etc folder
app/code/ScandiPWA/Version/etc/di.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<virtualType name="ScandiPWA\Router\Controller\ConfigurableRouter" type="ScandiPWA\Router\Controller\Router">
<arguments>
<argument name="ignoredURLs" xsi:type="array">
<item name="getscandipwaversion" xsi:type="string">^/scandipwa/version.*</item>
</argument>
</arguments>
</virtualType>
</config>
3. Run and set:up and c:f, navigate to http://localhost/scandipwa/version you should see the output.
Copy link