2

What is the major difference between Asp.Net Core SPA and separate them into Asp.Net Core WebAPI + independent web app. Here is my 2cent that separated solution looks no diff with using SPA template but the former makes backend code and folder structure more clear. Does it have any advantage to use Asp.Net Core SPA template?

2 Answers 2

4

WebAPI + independent web app benefits

Hosting : You can host your web app on low cost hosting solutions e.g. AWS S3/Azure blob storage.

Cloud native : Depending on your solution you can use cloud native technologies very easily . e.g. if you are using Serverless APIs , this kind of architecture works best in that case.

Flexibility : Your solution is hosting agnostic. Which means you publish apps on-prem or anywhere , as long as API contract is the same it will work.

Separate UI Team : UI team can focus solely on web app with out knowing anything about backend.


ASP.NET CORE SPA benefits

Better integration : Like someone mentioned you don't have worry about CORS.

Out of box Authentication/Authorization : If you are using ASP.NET CORE you can use out of box authentication solution. In the case above you have to write and implement your own authentication/Authorization logic. Also If you are deploying your solution to Azure. You can use Identity-tokens instead of Access-token to access your APIs which is handy.

Sign up to request clarification or add additional context in comments.

Comments

3

SPA

Using SPA template I can use built in Angular or React with ASP.Net Core without worry about CORS error, I can publish Angular app into production mode if I want by just clicking publish website in Visual Studio. Using SPA you can provide rich experiences for user. Using Angular SPA template is also support Server Side Render which is lead to performance improvement and build in Angular CLI support.

WebAPI + independent web app

You can easily seperate everything into smaller piece so that you can manage and scale up easily but it come with a cost maybe you have to host different kind of service in different domain and let them work together

So depend on what you need you can choose between thoose 2

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.