Socket
Socket
Sign inDemoInstall

ng-ssr-cli

Package Overview
Dependencies
117
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ng-ssr-cli

Angular2 server side rendering commandline client.


Version published
Weekly downloads
0
Maintainers
1
Install size
6.87 MB
Created
Weekly downloads
 

Readme

Source

ng-ssr-cli

Angular2 server side rendering commandline client.

work with angular2-universal.

DON'T USE npm install -g ng-ssr-cli

$ ngssr --help
  Usage: ngssr --templateHtml "<app></app>" --componentFile ./example/app.component.js --componentName AppComponent

  Options:

    --templateHtml <templateHtml>    string oftemplate html
    --templateFile <templateFile>    path to template html file
    --componentFile <componentFile>  path to component js file
    --componentName <componentName>  component class name
    --originUrl <originUrl>          specify origin url
    --baseUrl <baseUrl>              specify base url
    --reqUrl <reqUrl>                specify request url
    --outFile <outFile>              output file of generated html

$ ngssr --templateHtml "<app>" --componentFile ./example/app.component.js
<html>

<head>
  <title></title>
  <style>
    div[_ngcontent-eba-1] {
      color: red;
    }
  </style>
</head>

<body>
  <app _nghost-eba-1="">
    <h1 _ngcontent-eba-1="">ng-ssr-cli demo!</h1>

    <div _ngcontent-eba-1="">Hello, SSR!</div>

    <a _ngcontent-eba-1="" href="/cat">Cat</a>
    <a _ngcontent-eba-1="" href="/game">Game</a>

    <router-outlet _ngcontent-eba-1="">
    </router-outlet>
  </app>
</body>

</html>

How to use

In your project.

$ npm install --save-dev ng-ssr-cli angular2-universal preboot @angular/platform-server
$ $(npm bin)/ngssr --templateFile <path to your html> --componentFile <path to your root component>

see example

Try out

$ git clone git@github.com:vvakame/ng-ssr-cli.git
$ cd ng-ssr-cli
$ npm install

$ npm run build:example
$ npm start

$ npm run run-ngssr
.....!

FAQs

Last updated on 04 Jun 2016

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