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.
5 Replies
try: await fetch(api/API/availableListings)
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.
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?
Try it without the Controller suffix. The path '/api/API/availableListings' should work.