Socket
Socket
Sign inDemoInstall

@ngx-utils/express-engine

Package Overview
Dependencies
80
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ngx-utils/express-engine

Engine for server rendering Angular apps


Version published
Weekly downloads
3
Maintainers
1
Install size
13.8 kB
Created
Weekly downloads
 

Readme

Source

@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)

Keywords

FAQs

Last updated on 25 Jun 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc