Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {enableProdMode} from '@angular/core';
- import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
- import {AppModule} from './app/app.module';
- import {environment} from './environments/environment';
- import {LandingpageModule} from "./app-lp/components/landingpage.module";
- if (environment.production) {
- enableProdMode();
- }
- const hostname = window.location.hostname;
- const secondLevelDomain = hostname.split('.').reverse()[1];
- // let module = AppModule;
- // if(secondLevelDomain && secondLevelDomain !== 'www') {
- // module = LandingpageModule;
- // }
- let module = loadModuleByDomain();
- platformBrowserDynamic().bootstrapModule(module);
- function loadModuleByDomain() {
- const hostname = window.location.hostname;
- const secondLevelDomain = hostname.split('.').reverse()[1];
- if(secondLevelDomain && secondLevelDomain !== 'www') {
- return LandingpageModule;
- } else {
- return AppModule;
- }
- }
- at Object.resolveEntryModuleFromMain (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@ngtoolswebpacksrcentry_resolver.js:128:11)
- at AotPlugin._setupOptions (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@ngtoolswebpacksrcplugin.js:142:50)
- at new AotPlugin (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@ngtoolswebpacksrcplugin.js:26:14)
- at _createAotPlugin (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@angularclimodelswebpack-configstypescript.js:55:12)
- at Object.exports.getNonAotConfig (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@angularclimodelswebpack-configstypescript.js:70:19)
- at NgCliWebpackConfig.buildConfig (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@angularclimodelswebpack-config.js:27:37)
- at Class.run (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@angularclitasksserve.js:37:98)
- at check_port_1.checkPort.then.port (C:xampphtdocsprojekteontaviotalentstormclientnode_modules@angularclicommandsserve.js:103:26)
- at <anonymous>
- at process._tickCallback (internal/process/next_tick.js:169:7)
- import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
- import {LandingpageModule} from "./app-lp/components/landingpage.module";
- export function bootstrapLandingpageModule() {
- platformBrowserDynamic().bootstrapModule(LandingpageModule);
- }
- import {enableProdMode} from '@angular/core';
- import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
- import {environment} from './environments/environment';
- import {AppModule} from './app/app.module';
- import {bootstrapLandingpageModule} from "./main-lp";
- if (environment.production) {
- enableProdMode();
- }
- if(!isSubDomain()) {
- platformBrowserDynamic().bootstrapModule(AppModule);
- } else {
- bootstrapLandingpageModule();
- }
- function isSubDomain() {
- const hostname = window.location.hostname;
- const secondLevelDomain = hostname.split('.').reverse()[1];
- return !!(secondLevelDomain && secondLevelDomain !== 'www');
- }
Add Comment
Please, Sign In to add comment