Skip to content

Commit

Permalink
Enable autobuild and autoreload on file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideViolante committed Jan 9, 2017
1 parent dc9c6ef commit 8c87018
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ This project uses the [MEAN stack](https://en.wikipedia.org/wiki/MEAN_(software_

## Run
1. Command window 1: `mongod`: run MongoDB
2. Command window 2: `ng build -w`: build the project and keep watching the files for changes
3. Command window 3: `npm start`: run Express server
4. Go to [localhost:3000](http://localhost:3000)
2. Command window 2: `npm run be`: run Express backend server (with autoreload)
3. Command window 3: `npm start`: run Angular frontend (with autobuild and autoreload)
4. Browser will automatically open to: [localhost:4200](http://localhost:4200)

## Production
Run `ng build -prod` to create a production ready bundle.
Run `npm run prod` to run frontend with a production ready bundle.

## Preview
![Preview](https://raw.githubusercontent.com/DavideViolante/Angular2-Full-Stack/master/demo.gif "Preview")
Expand All @@ -34,13 +34,12 @@ Run `ng build -prod` to create a production ready bundle.
* you noticed any problem or error.

## To do
* tests
* browser autoreload on file changes
* Tests

## Running unit tests (to do yet)
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests (to do yet)
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "angular2-full-stack",
"version": "3.2.3",
"version": "3.3.1",
"license": "MIT",
"author": "Davide Violante",
"description": "Angular 2 full stack project.",
"angular-cli": {},
"scripts": {
"start": "nodemon src/server/app.js",
"start": "ng serve --proxy-config proxy.conf.json --open",
"prod": "ng serve --proxy-config proxy.conf.json --prod --open",
"be": "nodemon src/server/app.js",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
Expand All @@ -28,9 +30,9 @@
"express": "^4.14.0",
"font-awesome": "^4.7.0",
"jquery": "^3.1.1",
"mongoose": "^4.7.4",
"mongoose": "^4.7.6",
"morgan": "^1.7.0",
"rxjs": "^5.0.1",
"rxjs": "5.0.0-rc.4",
"tether": "^1.4.0",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
Expand Down
6 changes: 6 additions & 0 deletions proxy.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"/": {
"target": "http://localhost:3000",
"secure": false
}
}

0 comments on commit 8c87018

Please sign in to comment.