0

So I'm trying to justify my case of using ASP.Net Core with Angular in a new application, where the .NET application does little more that provide the basis for the Angular app. It's really similar to the case of having an ASP.NET MVC application with jQuery. There is also a Web Api involved.

So the two options being considered are:

  1. ASP.NET Core web app w/Angular for client side , along with a separate Web Api project, also done in ASP.NET Core
  2. Node.js project using just HTML w/Angular and the separate ASP.NET Core Web Api project

My preference for (1) is that is very likely we will need to execute some code on the server BEFORE any content is delivered back to the client. Even if that's not the case now, it very will likely be the case. The argument against this is that "the api can run code on the server".

So I suppose I need some examples of using ASP.NET hybrid type applications with angular AND there is actually something done in the ASP.NET application, other than simply serving up the Angular app.

I can almost see their point. Since after the initial delivery of the client app, there is little interaction with the ASP.NET code, all the user interaction is between the Angular client app and the Web Api. It would only be the case if the .NET web app actually had some server side routes defined for some controllers and/or razor pages that the .NET code within the web app would get involved.

1

1 Answer 1

1

The classic thing you need the server to do that front end devs ignore is authentication.

Before the web server serves you that static js, html or css file your request should be authenticated. With asp.net you would have a 'normal' Account/Login page to set the user up before redirecting to the SPA page.

Secondly, you should consider the 'backend api for the api'. Often you will want make your api calls from the backend of your webserver and forward the result so that you can auth the user and use a different auth, such as an API key that you want to keep secret, for the 'real' Api

Also this helps with CORS

Its really worth noting that Adding node to the equation when you are using .net for the api anyway is simply adding a extra technology for no reason.

1
  • Maybe I wasn't clear. The question is really concerning the web app that contains the angular code. Its a question of whether to make that an asp.net web app, or simply use html. Authentication is windows as this is an intranet app, so no login needed.
    – bitshift
    CommentedAug 21, 2018 at 20:12

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.