HI,
I am new to Forest Admin, I just set up the Forest Admin App connected to a Postgres database hosted on Heroku.
When I run Forest Admin locally,
Expected behavior
Show all the data, navigate between pages.
Actual behavior
Forest Admin works as expected when I run the server locally connected to the Heroko DB. The data is correctly fetched, I can navigate to the next 50 page, I can see the total number of items per table.
However, when run on Heroku, the data is indeed fetched and I can see the first page of results. However I am not able to navigate and show the next 50 elements or see the total number of items per table. I am able to search accross all items of each table.
Heroku Logs do not show any errors.
What might be causing this error ?
Thanks a lot for your help,
Chris
Hi @vince,
Thanks a lot for your reply.
Yes indeed, I do have a 403 (Forbidden) on the count request.
When I check the Forest Api message, I see “Forest cannot authenticate the user for this request.”.
This seems surprising because Forest the app has access to the data as it is showing the first page of results.
Okey this is what I though.
You are seeing this issue because of a conflict between 2 routes: the /modelName/:recordId and /modelName/count.
To fix it you just need to replace: /modelName/:recordId by /modelName/:recordId(?!count) and it should fix your issue
Awesome ! That did the trick, thanks a lot for your fast answers @vince.
Just for my understanding, how come the routes conflicted together ? I can’t see any overlap
And why only in production ?