# Cannot get Router Path

**URL:** <https://forum.ionicframework.com/t/cannot-get-router-path/176167>\
**Category:** Ionic Native\
**Created:** [October 23, 2019, 3:07pm UTC](https://forum.ionicframework.com/t/cannot-get-router-path/176167 "2019-10-23T15:07:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![migeruj](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/migeruj/32/128042_2.png) [@migeruj](https://forum.ionicframework.com/u/migeruj)\
**Post date:** [October 23, 2019, 3:07pm UTC](https://forum.ionicframework.com/t/cannot-get-router-path/176167/1 "2019-10-23T15:07:29Z")

</div>

Hi i got something peculiar on deployment.  
I have a web app with ionic with angular 8, when I’m routing to / index in localhost works. But when i make ng build and deploy to the server, i got a error “cannot GET /index”.

Someone know what is happening here?

Thanks for your supporting.

Regards

---

<div class="post-metadata">

**Author:** ![joelmeaders](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@joelmeaders](https://forum.ionicframework.com/u/joelmeaders)\
**Post date:** [October 23, 2019, 3:45pm UTC](https://forum.ionicframework.com/t/cannot-get-router-path/176167/2 "2019-10-23T15:45:55Z")

</div>

It’s probably the server configuration. Are you using nginx, apache, firebase hosting, etc…?

Also, make sure there’s an index.html in your project output folder (www, public or whatever it’s set to). THere probably is but it doesn’t hurt to check.

---

<div class="post-metadata">

**Author:** ![migeruj](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/migeruj/32/128042_2.png) [@migeruj](https://forum.ionicframework.com/u/migeruj)\
**Post date:** [October 23, 2019, 3:56pm UTC](https://forum.ionicframework.com/t/cannot-get-router-path/176167/3 "2019-10-23T15:56:33Z")

</div>

Hi Joel! Thanks for your time. We are using express to serve the webapp. Heroku is our cloud service on deploy.

Regards

---

<div class="post-metadata">

**Author:** ![joelmeaders](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@joelmeaders](https://forum.ionicframework.com/u/joelmeaders)\
**Post date:** [October 23, 2019, 4:03pm UTC](https://forum.ionicframework.com/t/cannot-get-router-path/176167/4 "2019-10-23T16:03:03Z")

</div>

If express is serving it I would imagine it’s somewhere in the middleware but since it works on localhost maybe it’s a Heroku issue and the files are stored in a different location for prod?

```auto
// ---- SERVE STATIC FILES ---- //
app.server.get('*.*', express.static(APPPATH, {maxAge: '1y'}));

// ---- SERVE APLICATION PATHS ---- //
app.all('*', function (req, res) {
    res.status(200).sendFile(`/`, {root: APPPATH});
});

```

---

<div class="post-metadata">

**Author:** ![migeruj](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/migeruj/32/128042_2.png) [@migeruj](https://forum.ionicframework.com/u/migeruj)\
**Post date:** [October 23, 2019, 5:00pm UTC](https://forum.ionicframework.com/t/cannot-get-router-path/176167/5 "2019-10-23T17:00:43Z")

</div>

Thanks Joe, I implement the serve aplication paths with root: APPPATH and works like a charm.

Thanks for your help
