> For the complete documentation index, see [llms.txt](https://docs.scandipwa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scandipwa.com/tutorials/accessing-magento-2-controllers/step-2-create-magento-2-frontend-route-and-basic-controller.md).

# STEP-2 - Create Magento 2 Frontend Route and Basic Controller

1. At **\[MODULE]/etc** folder create **frontend** folder and **routes.xml** file in it

{% code title="app/code/ScandiPWA/Version/etc/frontend/routes.xml" %}

```markup
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
   <router id="standard">
       <route id="scandipwa"  frontName="scandipwa" >
           <module name="ScandiPWA_Version"/>
       </route>
   </router>
</config>
```

{% endcode %}

2\. At **\[MODULE]** create **/Controller/Version** folders and I**ndex.php** in the **Version** folder

{% code title="app/code/ScandiPWA/Version/Controller/Version/Index.php" %}

```php
<?php

namespace ScandiPWA\Version\Controller\Version;

use Magento\Framework\App\Action\Action;

class Index extends Action
{
   /**
    * @return void
    */
   public function execute()
   {
       echo('Version 5.0.6');
   }
}
```

{% endcode %}

4\. Run and `set:up`  and `c:f`, switch to **Luma** theme, if you will navigate to [**http://localhost/scandipwa/version**](https://localhost/scandipwa/version) you should see the output, however, if you will switch back to **ScandiPWA** theme you going to see 404 Page.

\
**Useful Materials**\
[Magento 2 Creating a New Page](https://devdocs.magento.com/videos/fundamentals/create-a-new-page/)
