Chris Tarasovs
Chris Tarasovs

Reputation: 695

How to deploy Angular universal

I looking into Angular universal and trying to get my head around deployment. Github https://github.com/angular/universal-starter

It has Angular 2 Universal + TypeScript 2 + Webpack 2

When I run the command

npm run build

I get the following structure

**Client**
0.bundle
0.bundle.js.map
main.bundle
main.bundle.js.map

**Server**
0.index
0.index.js.map
index
index.js.map

How do I deploy this to a server?

Upvotes: 1

Views: 1155

Answers (1)

Cacoon
Cacoon

Reputation: 2538

Install dependencies

Run npm install in your terminal at the root of universal-starter

Run the NodeJS backend

Run npm run build:ssr && npm run serve:ssr after npm install has finished, this will host a local nodejs server here: http://localhost:4000 (you can put that in your browser)

Before either of these steps ensure you have NodeJS and NPM installed (NPM comes with the newer builds of NodeJS)

Upvotes: 1

Related Questions