Book Image

Node.js Blueprints

By : Krasimir Stefanov Tsonev
Book Image

Node.js Blueprints

By: Krasimir Stefanov Tsonev

Overview of this book

Table of Contents (19 chapters)
Node.js Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preparing the application


We have worked on applications in the previous chapters. For this application, we need a Node.js server, which will deliver the necessary HTML, CSS, and JavaScript code. The following is the package.json file, which we are starting from:

{
  "name": "TwitterFeedShower",
  "description": "Show Twitter feed",
  "version": "0.0.1",
  "dependencies": {
    "twit": "*"
  },
  "main": "index.js"
}

There is only one dependency and that's the module that will connect to Twitter. After you run npm install in the same folder as the package.json file, the module will appear in the newly created node_modules directory.

The next step is to create the folders for the HTML, CSS, and JavaScript and put the necessary files inside these folders. In addition, create the main index.js file that will contain the code of our Node.js server. At the end, our project directory should look like the following diagram:

The CSS styles of the project will go to css/styles.css. The templates will...