![]() Var morgan = require('morgan') // formerly express.logger Ultimately, this file will be passed to the Node executable to start your server. The node-server.js file is a simple JavaScript file that defines how your server should be configured. This can be done in three easy steps… Step 1 – Create node-server.js This can be done extremely easily by creating a server configuration file and running it with the Node executable. In my case, I need to use it to run a simple web server to serve up my web app. NodeJS is a JavaScript platform that can be used to build fast network applications. Wondering how these components got here? When your ran npm install the package.json file contained a postinstall instruction to run bower install which read your bower.json file to determine which components needed to be downloaded and added to this folder. app/bower_components – This folder contains all the bower dependencies required at runtime by your application.app/app.js – This is where the root module for your AngularJS application is defined.app/index.html – This is the basis of your single-page web app, notice that there is quite a bit of HTML and wiring already done for you.You should see a bunch of AngularJS dependencies. bower.json – This file is used by Bower to understand the application and the dependencies that are required in the browser to run the application.Check out the devDependencies section… do you recognize any of those? ![]() package.json – This file is used by NPM to understand the project and its dependencies.I would recommend reviewing the following files: It can be helpful to browse through the code and configuration that is included in the seed project to get a feel for how everything is wired up. You can run this command via the Windows command line or even through WebStorm’s Terminal view: Once the project is opened in WebStorm, the first thing you’ll want to do is run npm install on the project to bring down all of the NPM (and Bower) dependencies into the project. Fortunately, WebStorm allows you to skip this step and create a new project based on the angular-seed project: To start using the angular-seed project, you can download the source from GitHub or use your favorite Git client to clone the project. The angular-seed project provides a common application folder structure and basic configuration files for some popular development tools including NPM (package manager), karma (for unit testing), protractor (for end-to-end testing) and bower (a client-side package manager). JetBrains WebStorm (or another IDE of your choosing… or Notepad if you are a glutton for punishment).I will assume that you have the following software installed: I will attempt to explain how to create a Node server configuration using some common Express framework components. It allows you to get an AngularJS single-page web app up and running very quickly. If you want to run your web app with NodeJS then you will need to create a basic Node server. The angular-seed project on GitHub is a great way to start playing with AngularJS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |