Coder Social home page Coder Social logo

sifawm / angular-universal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enten/angular-universal

1.0 1.0 0.0 102 KB

Angular 6 Universal starter kit based on @angular/cli featuring Server-Side Rendering (SSR) and HMR on browser/server sides

JavaScript 20.13% TypeScript 70.31% HTML 9.06% CSS 0.50%

angular-universal's Introduction

NgUniversal

This project was generated with Angular CLI version 6.0.0-rc.5.

Demo

Live Demo is running on now.sh.

About

This starter kit contains all the minimal tooling and configuration you need to kick off your next universal Angular 6 project.

It combines @angular/cli and udk to won't have to write specific code for development purposes only.

Features

Getting started

git clone https://github.com/enten/angular-universal my-project
cd my-project
npm install
npm start

Development server

Two different dev servers are provided:

  • The universal dev server which enable SSR (build browser and server targets) ;
  • The SPA dev server which is a webpack dev server (build browser target only).

SPA dev server can be useless (or "broken"): it depends on your server implementation.

Universal dev server

Run npm run dev (or npx ng-udkc) for an universal dev server. Navigate to http://localhost:4000/.

The app will automatically hot-reload on server and browser sides if you change any of the source files.

The server will automatically restart if a change occured in metafiles and metadirs defined in udk.container.js.

Universal dev server with ng-udkc

SPA dev server

Run npm run dev:spa (or npx ng serve --hmr) for a SPA dev server Navigate to http://localhost:4200/.

The app will automatically reload if you change any of the browser source files.

Note: the universal dev server provide an SPA mode too if you navigate to the index.html: http://localhost:4000/index.html.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run npm run build to build the project. The build artifacts will be stored in the dist/app directory.

Run npm run build:prod for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

angular-universal's People

Contributors

enten avatar

Stargazers

Paula Fernández López avatar

Watchers

Fernando Gómez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.