adsense

Sunday, December 31, 2023

Integrating Vue with .Net Core

 When integrating Vuie Js with .Net Core 6/7, I found this youtube video really helpful.  As .Net core APi and Vue js run in its own port I had to first run the API in one browser instance and Vue js frontend in another instance (typically http://localhost:8080/)


Cheers,

Samitha 

Saturday, December 30, 2023

Fixing 'Access-Control-Allow-Origin' error in ASP.NET Core 6/7

 When working with a WEB API if you want to share resources between different domains we need to enable CORS in Program.cs as shown below.


app.UseCors(builder => builder
       .AllowAnyHeader()
       .AllowAnyMethod()
       .AllowAnyOrigin()
    );

Note that it is recommended to have this after app.UseRouting(); middleware.

Cheers,
Samitha

Friday, December 29, 2023

Multiple Directories for Static Files in ASP.NET Core

 I was under the impression Asp.Net core can have only one directory for static files. Recently I came across this article and it shows how we can configure multiple directories for Static Files in ASP.NET Core.

Cheers,

Samitha

Thursday, December 21, 2023

Windows 11/10: uninstall problematic Programs


Recently my machine gave me some trouble when trying to remove some app from it. I came across this useful post having options remove problematic apps/programs from a windows 10/11 PC.

From the given list Method V - Run the Microsoft Install/Uninstall troubleshooter was the quickest one worked for me.


Cheers,

Samitha



Thursday, December 14, 2023

Response Codes in WEB API

 When designing WEB APIs we, as developers are interested in response codes returned after doing an operation.


Following are the response codes and there meanings

  • 1xx: Informational – Indicates transfer protocol-level information.
  • 2xx: Success – This confirms that the client’s request was accepted successfully.
  • 3xx: Redirection – Request is not completed. The client must take some additional action to complete their request.
  • 4xx: Client Error – Indicates that there is some error in API code.
  • 5xx: Server Error – Indicates an error occurred due to some environment settings.

Regards,

Samitha