I'd like to run two seperate applications on the same port, one for the 'customers' and the other for the 'administators'. In angular cli you can add multiple apps in the .angular-cli.json but you can't run them at the same time. Does anyone know how I can fix this problem?
You can create a new module that includes both of apps.
1. Add a new app to .angular-cli.json:
"apps": [
{
"name": "all",
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main-all.ts",
"polyfills": "polyfills.ts",
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}, .......
2. Create main-all.ts file such as you do for other apps. https://github.com/angular/angular-cli/wiki/stories-multiple-apps
3. Create a common module:
@NgModule({
declarations: [],
imports: [
AppModule1,
AppModule2
],
providers: [],
bootstrap: [AppComponent1, AppComponent2]
})
export class AppModuleAll {}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With