muskagap
✅ Deploying Node app along with .Net Core on IIS
Hello guys, I am looking for an answer for how to deploy and host ASP.NET Core app along with Vue.js.
I developed the frontend app separately from the backend. My backend exposes an API for Vue.js. My backend is .NET Core API app. What's the best solution/practice to make them work together on IIS? I read some articles and this is what I got:
Once Vue app is ready just build it. Then create wwwroot folder in .NET Core API and move all files from 'dist' folder (where is Vue built version) to wwwroot. Then add app.UseStaticFiles() middleware component in the ‘Configure()’ method of Startup.cs file. Configure CORS properly. Next, publish your project in VS and move all files to the IIS server.
I have several questions:
1. Is the above the best practice to deploy both apps together?
2. Do I always need to copy-paste built version of my seperate frontend to wwwroot? Can't I just store Vue files in some other place on IIS server and communicate both apps (API and Vue) via http protocol?
3. Now I make calls from Vue to API using axios. I point to specific location (endpoint) in my API to extract data. If I moved all Vue files to wwwroot folder (which is currently added under API project) could I still make calls to API or not?
4. And last one - are there any other configurations I should make in order to make it work together? Like setting environment path or changing mode from development to production etc.?
I would appreciate your kind reply. If you have any experience with this topis please let me know.
38 replies
❔ How to publish multiple projects under one solution?
I created ASP.Net Core API project, 4 library projects and a few unit test projects - all under one Solution. I use Visual Studio 2019. What I want to achieve is to publish all of them as one project and then host on IIS. I have read some articles on the web regarding that issue but there are various approaches. I would like to know what are best practices/ your practical experience in that field. How can I do this the easiest way?
And second question: I will be hosting the project on Windows Server 2012 R2. Should I configure IIS somehow to support such deployment?
14 replies
❔ How should I correctly interact .NET Core App with client-side app?
Hello guys. I'm trying to resolve some issue and would like you to explain me how some things work. I created Vue2 app. I also created .NET Core app which serves as my backend. Now I want both apps to interact with each other. I know that they need to communicate through API. However, I have more technical questions regarding how technically this should be done (I developed Vue app but I think the pattern works for Angular, React and other frameworks):
1. Does my backend need any API proxy/API gateway to make calls through
axios
from Vue? So the question is if axios
should communicate to API gateway or directly to services endpoints (every single API service)?
2. Should I need to use other tools e.g. NSwag
to auto-generate code which interact with backend API? Is NSwag
code a kind of API Gateway in this case?51 replies
❔ How to properly design microservice architecture in ASP Net Core?
Hello everyone. It's going to be my first try to follow microservice architecture pattern. I have read lots of articles on the web but still have a few doubts and questions about this topic. I'm wondering how should I design the project in ASP Net Core. Especially:
1. should I create multiple services under one solution?
2. should I create a new solution for each service?
3. should I create API Gateway as an app in seperate solution or under existing solution (e.g. along with one of the services)?
4. should I always containerize microservices or not?
5. is it possible to deploy microservices apps without containerization?
6. I have one server with one database where all data is stored. I read that each service should have its own database. Can I use one database for each service (but each service will be using different tables , not share the same tables)?
7. does it make sense to create seperate service where all required data from database/s is stored (e.g. data from a few servers)? And then other services (e.g. Payments, Products, Clients etc.) would communicate with this data service to make CRUD operations? Normally, each service should have its own database but what about this approach?
Thank you for your answers
28 replies