Getting started with Angular 2 with node.js/expressjs backend (http example included)

 Getting started with Angular 2 with node.js/expressjs backend (http example included)



We will create a simple "Hello World!" app with Angular2 2.4.1 (@NgModule change) with a node.js (expressjs) backend.

 Prerequisites 
  1. Node.js v4.x.x or higher
  2.   npm v3.x.x or higher or yarn 
Then run npm install -g typescript or yarn global add typescriptto install typescript globally

 Roadmap 
Step 1
 Create a new folder (and the root dir of our back-end) for our app. Let's call it Angular2-express

command line:

mkdir Angular2-express
 cd Angular2-express

Step2

 Create the package.json (for dependencies) and app.js (for bootstrapping) for our node.js app. 

package.json: 

     "name": "Angular2-express",
    "version": "1.0.0",
    "description": "", 
   "scripts": { "start": "node app.js" }, 
   "author": "", 
   "license": "ISC",
 "dependencies": { 
       "body-parser": "^1.13.3", 
       "express": "^4.13.3" 
   }
 }


About Sudhir Kumar

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

0 σχόλια :

Post a Comment