简体   繁体   中英

How to run two Angular projects on the same port

I am developping a project where I have more than one angular projects. I would like to launch them on the same port (localhost:4000). Is this possible? Can Angular launch an app of two projects on the same port?

You only have to host both project on their respective directory (IIS configuration needed) and build/deploy your apps with the base-href option:

ng build --prod --base-href=/admin // admin app
ng build --prod // public app

It would be possible to combine them under one project.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects", 
  "projects": {
    "artists": {
         //This section contains the setting for the artists project      
    },
    "user": {
        //This section contains the setting for the user project
    }},
  "defaultProject": "artists"    
}
 

I believe you are looking for something like this: https://www.tektutorialshub.com/angular/angular-multiple-apps-in-one-project/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM