IMPORTANT!
This forum is now archived. Click here for the New Support Forum
Why are both Angular and WebAPI combined into a single project?
Quote from arjan on January 7, 2020, 2:34 pmHi,
I was wondering why both the web API and the Angular website within the quickapp were combined into a single web application. Would it not be better to have them separated into one web application for the API, one for the frontend and a third for the DAL?
We could then also make changes and additions to the API independently saving recompile time as well.
Best regards,
Arjan.
Hi,
I was wondering why both the web API and the Angular website within the quickapp were combined into a single web application. Would it not be better to have them separated into one web application for the API, one for the frontend and a third for the DAL?
We could then also make changes and additions to the API independently saving recompile time as well.
Best regards,
Arjan.
Quote from Eben Monney on May 19, 2021, 1:54 amHello Arjan,
We do this to keep things simple.
We keep the ClientApp and the WebAPI which drives the ClientApp in the same project, whilst we separate app logic and database related operations into the DAL.
The starting project is simple enough to have just these 2 separations and you SHOULD add more projects as your Business logic dictates. The idea is to have something simple to get you started and adopt it to your taste as your project demands.Keep in mind the ClientApp folder is a separate self contained angular project that is capable of being managed independently even though it resides in the main project.
If you preferred you could move it into another project and point your main project to it and still benefit from the seamless integration.
Steps:
- Create a new project in the solution
- Add the line "<DefaultItemExcludes>$(DefaultItemExcludes);$ClientApp\node_modules\**</DefaultItemExcludes>" to the CSPROJ file of the new project
- Move the ClientApp folder into the new project
- Point spa.Options.SourcePath in Startup.cs to the new location. E.g. spa.Options.SourcePath = "../FrontEnd/ClientApp";
- Update the locations of ClientApp in the main project's CSPROJ file to point to the new location
Regards,
Eben Monney
Hello Arjan,
We do this to keep things simple.
We keep the ClientApp and the WebAPI which drives the ClientApp in the same project, whilst we separate app logic and database related operations into the DAL.
The starting project is simple enough to have just these 2 separations and you SHOULD add more projects as your Business logic dictates. The idea is to have something simple to get you started and adopt it to your taste as your project demands.
Keep in mind the ClientApp folder is a separate self contained angular project that is capable of being managed independently even though it resides in the main project.
If you preferred you could move it into another project and point your main project to it and still benefit from the seamless integration.
Steps:
- Create a new project in the solution
- Add the line "<DefaultItemExcludes>$(DefaultItemExcludes);$ClientApp\node_modules\**</DefaultItemExcludes>" to the CSPROJ file of the new project
- Move the ClientApp folder into the new project
- Point spa.Options.SourcePath in Startup.cs to the new location. E.g. spa.Options.SourcePath = "../FrontEnd/ClientApp";
- Update the locations of ClientApp in the main project's CSPROJ file to point to the new location
Regards,
Eben Monney
IMPORTANT!
This forum is now archived. Click here for the New Support Forum