ABC. Net Core API and Angular front-end APP integrated deployment, abpangular

Source: Internet
Author: User

ABC. Net Core API and Angular front-end APP integrated deployment, abpangular

Preface:
Generated on the ABC official website (https://aspnetboilerplate.com. net Core + Angular projects are two independent projects. We can deploy them separately or integrate the frontend and Web APIs. Let's try integration and deployment today.

Frontend Packaging
Make sure that there is no problem with front-end installation and running, how to install and run please refer to blog: http://www.cnblogs.com/donaldtdz/p/7705605.html
Run the ng build command to package. A dist directory is automatically created in the project root directory.
 

2. Packaging and integration
1. copy the files in the dist directory packaged in step 1 to the wwwroot directory in the background host project (Note: all the static files packaged must be placed in the wwwroot directory, this directory is the root directory of static website resources for subsequent static and dynamic separation and deployment)


2. Create a New View PhotoStory in HomeController. (Note: You can create a View for integration testing. You can create a project based on your needs)


3. copy the code to the PhotoStory view in the index.html file of the distdirectory.
 

<! Doctype html> 


4. Return the default route Index to the view PhotoStory. The integration is complete.

public IActionResult Index(){    //return Redirect("/swagger");     return View("PhotoStory");}

 
Three Integration run test
 
Change the URL to http: // localhost: 21021/swagger/the Web API page that will be redirected
 

 

If you need to pay attention to cross-origin issues before and after independent deployment, you can view the blog: http://www.cnblogs.com/donaldtdz/p/7882225.html

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.