How to use the @nestjs/ng-universal.AngularUniversalModule.forRoot function in @nestjs/ng-universal

To help you get started, we’ve selected a few @nestjs/ng-universal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github servrox / nx-ng-nest-universal / apps / nest-test-app / src / app / app.module.ts View on Github external
import { Module } from '@nestjs/common';
import { AngularUniversalModule, applyDomino } from '@nestjs/ng-universal';
import { join } from 'path';

import { AppController } from './app.controller';
import { AppService } from './app.service';

const BROWSER_DIR = join(process.cwd(), 'dist', 'apps', 'ng-test-app');
applyDomino(global, join(BROWSER_DIR, 'index.html'));

@Module({
  imports: [
    AngularUniversalModule.forRoot({
      viewsPath: BROWSER_DIR,
      bundle: require('../../../../dist/apps/ng-test-app-server/main'),
      liveReload: true
    })
  ],
  controllers: [AppController],
  providers: [AppService]
})
export class AppModule {}
github kamilmysliwiec / universal-nest / server / app.module.ts View on Github external
import { Module } from '@nestjs/common';
import { AngularUniversalModule, applyDomino } from '@nestjs/ng-universal';
import { join } from 'path';
import { AppController } from './app.controller';

const BROWSER_DIR = join(process.cwd(), 'dist/browser');
applyDomino(global, join(BROWSER_DIR, 'index.html'));

@Module({
  imports: [
    AngularUniversalModule.forRoot({
      viewsPath: BROWSER_DIR,
      bundle: require('../server/main'),
      liveReload: true,
    }),
  ],
  controllers: [AppController],
})
export class ApplicationModule {}
github ForetagInc / fullstack-ts-boilerplate / apps / ssr / src / app.module.ts View on Github external
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { AngularUniversalModule } from '@nestjs/ng-universal';
import { transferStateMiddleware } from '@foretag/transfer-state';

import { webFolder, webServerFolder } from './utils';

@Module({
  imports: [
    AngularUniversalModule.forRoot({
      viewsPath: webFolder(),
      bundle: require(webServerFolder('main.js')),
    }),
  ],
})
export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    return consumer
      .apply(transferStateMiddleware)
      .exclude('assets')
      .forRoutes('*');
  }
}
github servrox / nx-ng-nest-universal / server / app.module.ts View on Github external
import { Module } from '@nestjs/common';
import { AngularUniversalModule, applyDomino } from '@nestjs/ng-universal';
import { join } from 'path';

const BROWSER_DIR = join(process.cwd(), 'dist', 'browser');
applyDomino(global, join(BROWSER_DIR, 'index.html'));

@Module({
  imports: [
    AngularUniversalModule.forRoot({
      viewsPath: BROWSER_DIR,
      bundle: require('../server/main'),
      liveReload: true
    })
  ]
})
export class ApplicationModule {}
github colmena / angular-nest-universal-starter / apps / api / src / app / server-app.module.ts View on Github external
import { Module } from '@nestjs/common';
import { join } from 'path';
import { AngularUniversalModule, applyDomino } from '@nestjs/ng-universal';
import { ServerAppController } from './server-app.controller'

@Module({
  controllers: [ServerAppController],
  imports: [
    AngularUniversalModule.forRoot({
      viewsPath: join(process.cwd(), 'dist', 'apps', 'admin'),
      bundle: require('../../../../dist/apps/admin-server/main.js'),
    }),
  ],
})
export class ServerAppModule {}
github adrien2p / teanjs / server / app.module.ts View on Github external
import { join } from 'path';
import { Module } from '@nestjs/common';
import { AngularUniversalModule, applyDomino } from '@nestjs/ng-universal';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserModule } from './modules/user/user.module';
import { AuthModule } from './modules/authentication/auth.module';
import * as databaseConfig from './environments/database';

const BROWSER_DIR = join(process.cwd(), 'dist/browser');
applyDomino(global, join(BROWSER_DIR, 'index.html'));

@Module({
    imports: [
        AngularUniversalModule.forRoot({
            viewsPath: BROWSER_DIR,
            bundle: require('../server/main.js'),
            liveReload: true
        }),
        TypeOrmModule.forRoot(databaseConfig),
        UserModule,
        AuthModule
    ]
})
export class ApplicationModule {}
github nestjs / ng-universal / schematics / install / files / root / server / app.module.ts View on Github external
import { Module } from '@nestjs/common';
import { AngularUniversalModule } from '@nestjs/ng-universal';
import { join } from 'path';

@Module({
  imports: [
    AngularUniversalModule.forRoot({
      viewsPath: join(process.cwd(), '<%= getBrowserDistDirectory() %>'),
      bundle: require(join(
        process.cwd(),
        '<%= getServerDistDirectory() %>/main'
      )),
      liveReload: true
    })
  ]
})
export class ApplicationModule {}
github valor-software / ngx-bootstrap / scripts / universal / app.module.ts View on Github external
import { Module } from '@nestjs/common';
import { join } from 'path';
import { AngularUniversalModule, applyDomino } from '@nestjs/ng-universal';

const BROWSER_DIR = join(process.cwd(), process.env.DYNO ? 'browser' : 'demo/dist/browser');

applyDomino(global, join(BROWSER_DIR, 'index.html'));

@Module({
  imports: [
    AngularUniversalModule.forRoot({
      viewsPath: BROWSER_DIR,
      bundle: require('./../../demo/dist/server/main.js')
    })
  ]
})
export class ApplicationModule {}

@nestjs/ng-universal

Nest - modern, fast, powerful node.js web framework (@ng-universal)

MIT
Latest version published 1 year ago

Package Health Score

47 / 100
Full package analysis

Similar packages