C
C#2mo ago
morry329#

Not found 404 at await fetch

I have been developing a simple ASP.NetCore web app. Now my task is to load backend data onto frontend which I struggle a lot I keep getting 404 errors on my Chrome devtool once the dotnet run is hit and a browser opens All the relevant codes right here https://pastebin.com/R8dCFJgC You can view my explorer tree per screenshot in the attachment Please point me in the right direction
Pastebin
/* View - cshtml */@{ ViewData["Title"] = "Dashboard";}
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
No description
5 Replies
i_umarov
i_umarov2mo ago
try: await fetch(api/API/availableListings)
Suiram1
Suiram12mo ago
The list should be currently available under /api/API/availableListings as i_umarov mentiont. The reason for this is that the [controller] inside the route attributes adds the name of the controller without the controller suffix.
morry329#
morry329#OP2mo ago
Hi! So I tried like this await fetch('/api/APIController/availableListing') Unfortunately the 404 error stays as per screenshot attached What could cause this? Maybe the API controller did trigger this 404?
morry329#
morry329#OP2mo ago
No description
Suiram1
Suiram12mo ago
Try it without the Controller suffix. The path '/api/API/availableListings' should work.
Want results from more Discord servers?
Add your server