<p>You'll either need to use the action url <code>http://localhost/actions/my-module/scrape/push</code> since only those will route to controllers by default or create a custom route to your controller </p>

CC BY-SA 4.0
2018-08-10T05:18:49.230Z
2018-08-10T05:18:49.230Z
Robin Schambach
<p>I'm a total Craft newbie, so I hope this question isn't ridiculous.</p>

<p>I just want to see a controller / action work in my new module.</p>

<p>I have src/controllers/ScrapeController.php as such:</p>

<pre><code>&lt;?php

namespace mycompany\mymodule\controllers;

use craft\web\Controller;

class ScrapeController extends Controller {

    public function actionPush()
    {
        return $this-&gt;asJson([
            'success' =&gt; TRUE,
        ]);
    }
}
</code></pre>

<p>And I just want to see this URL work: <a href="http://localhost/my-module/scrape/push" rel="nofollow noreferrer">http://localhost/my-module/scrape/push</a></p>

<p>But instead I get: <strong>HTTP 404 - Template not found</strong></p>

<p>I'm sure I'm missing something really dumb here. Any ideas?</p>

<craft3><controller><modules>
"Template Not Found" error when trying to access a module controller action
# "Template Not Found" error when trying to access a module controller action

(Asked by: username_0 on 2018-08-09)

I'm a total Craft newbie, so I hope this question isn't ridiculous.
I just want to see a controller / action work in my new module.
I have src/controllers/ScrapeController.php as such:
asJson([
            'success' => TRUE,
        ]);
    }
}

And I just want to see this URL work: http://localhost/my-module/scrape/push
But instead I get: HTTP 404 - Template not found
I'm sure I'm missing something really dumb here. Any ideas?

**Tags:** craft3, controller, modules


---

## 1 answers

### Answer by username_1 on 2018-08-10. Score: 3 | Accepted answer

You'll either need to use the action url `http://localhost/actions/my-module/scrape/push` since only those will route to controllers by default or create a custom route to your controller


---

