Skip to content

ngx-ssr 3.0.0-pr15.19

Install from the command line:
Learn more about npm packages
$ npm install @shiftcode/ngx-ssr@3.0.0-pr15.19
Install via package.json:
"@shiftcode/ngx-ssr": "3.0.0-pr15.19"

About this version

@shiftcode/ngx-ssr

Services and helpers used for server side rendering.

  • SsrHttpInterceptor to rewrite relative urls on ssr
    • when in Lambda: rewrites to ${env.FINAL_DOMAIN}/${relativeUrl}
    • when local: rewrites to ${request.protocol}://${request.hostname}:4000/${relativeUrl}

Usage

  • Make sure the environment Variable FINAL_DOMAIN is set
import { ServerModule, ServerTransferStateModule } from '@angular/platform-server'
import { ORIGIN_PROVIDER, SsrHttpInterceptor } from '@shiftcode/ngx-ssr'
import { AppComponent } from './app.component'
import { AppModule } from './app.module'

@NgModule({
  imports: [ServerModule, ServerTransferStateModule, AppModule],
  providers: [
    ORIGIN_PROVIDER,
    { provide: HTTP_INTERCEPTORS, useClass: SsrHttpInterceptor, multi: true },
  ],
  bootstrap: [AppComponent],
})
export class AppServerModule {}

depends on

  • @angular/core + @angular/commons
  • @nguniversal/express-engine
  • express
  • @shiftcode/ngx-core (Logger)

Details


Assets

  • ngx-ssr-3.0.0-pr15.19.tgz

Download activity

  • Total downloads 7
  • Last 30 days 0
  • Last week 0
  • Today 0