.Net Core 7 backend developed but , it is not Working SSR Fetch in NextJS #53676
-
I have developed an ASP.NET Core 6 Web API. Now, I want to use this API in the frontend with NextJS. While server-side rendering, I cannot access the data and encounter errors, but I can access the data during client-side rendering. How can I solve this? I used macbook therefore I use docker for my SQL Server:
This is my BackEnd's program.cs gist. This is my SSR code: I'm really researching and trying many techniques but haven't found a solution yet. I'm new to backend development with .Net, I was told to try methods like {mode:'no-cors'} in my research on the internet, I tried them but unfortunately I couldn't get a result. My node version is : v20.5.0 Also my nextjs version is : "next": "13.4.12", |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 20 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I guess, the .NET API is in the "same" network as your browser, but the Next.js app is not? How's the Next.js app running? Or rather in which environment is it started, and how? |
Beta Was this translation helpful? Give feedback.
-
the detail about MSQL and docker is irrelevant. remove that information or strike it out... it'll just confuse the situation.
|
Beta Was this translation helpful? Give feedback.
I change my launch setting file , i have to remove all ssl configuration for it
{ "$schema": "https://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:13187", "sslPort": 0 } }, "profiles": { "http": { "commandName": "Project", "launchBrowser": true, "launchUrl": "swagger", "applicationUrl": "http://localhost:5031", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "dotnetRunMessages": true }, "https": { "commandName": "Project", "launchBrowser": true, "launchUrl": "swagger", "applicationUrl": "http://localhost:7039;http://localhost:5031", "envi…