A basic starter project that features Angular 2 with ES6 and Express/Node. Has fully integrated unit and e2e tests. Also, has the ability to build for production and configuration based on the environment!
Huge Kudos goes to the Angular2 Webpack Starter for being a great example!
# Clone the repo
git clone https://github.com/jgodi/angular2-fullstack-starter.git
# CD into the project
cd angular2-fullstack-starter
# Install all required dependencies
npm install
# Start the server (uses WebpackDevServer for development)
npm start
Now, navigate to http://localhost:3000 in your browser and code!
# Run unit tests
npm test
Will run all karma unit tests. Coverage will be reported in /coverage
.
Make sure to install the webdriver before hand using npm run webdriver-update
.
# Start the application in one command prompt
npm start
# Start the webdriver in another command prompt
npm run webdriver-start
# Finally, run the e2e test in a third command prompt
npm run protractor
Building this application is easy, there are a few commands to make it very easy. It uses the index.html
file that is located in public
as a base template and outputs a build version of it into server/views/index.html
to be served up via node.
To build a development version of the application, run the following commands:
# Build a development version
npm run build:dev
To build a fully optimized production version of the application, run the following commands:
# Build a production version
npm run build:prod
To run the production version of the application, run the following commands:
npm run build:prod
npm run start:prod
Configuration is controlled via convict.
To add custom configuration, you first must modify the scheme located in server/config.js
. Once you have the scheme in place, then go into server/config/*
and add the value for each environment.
To change/remove/add environments, just look at the scheme and change the default format for env
.