This package has been deprecated

Author message:

This package is no longer supported and not relevant.

@ngx-utils/express-engine
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ngx-utils/express-engine

npm version npm downloads

Engine for server rendering Angular apps

Table of contents:

Prerequisites

This package depends on @angular v4.0.0 and express.

Install express from npm:

npm install express --save

Installation

Install @ngx-utils/express-engine from npm:

npm install @ngx-utils/express-engine --save

Example of usage

Simple exapmle of express server using @ngx-utils/express-engine:

import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import * as express from 'express';
import { enableProdMode } from '@angular/core';
import { ngExpressEngine } from '@ngx-utils/express-engine';

import { ServerAppModuleNgFactory } from './ngfactory/server.module.ngfactory';
import { environment } from './environments/environment';

const app = express();

enableProdMode();

app.engine('html', ngExpressEngine({
  aot: true,
  bootstrap: ServerAppModuleNgFactory
}));

app.set('view engine', 'html');
app.set('views', 'dist/client');

app.get('*', (req, res) => {
  res.render('../client/index', {cache: true, req, res});
});

app.listen(environment.port);

License

The MIT License (MIT)

Package Sidebar

Install

npm i @ngx-utils/express-engine

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • anton_barada