You are previewing Advanced Express Web Application Development.
O'Reilly logo
Advanced Express Web Application Development

Book Description

For experienced JavaScript developers this book is all you need to build highly scalable, robust applications using Express. It takes you step by step through the development of a single page application so you learn empirically.

  • Learn how to build scalable, robust, and reliable web applications with Express using a test-first, feature-driven approach

  • Full of practical tips and real world examples, and delivered in an easy-to-read format

  • Explore and tackle the issues you encounter in commercially developing and deploying an Express application

  • In Detail

    Building an Express application that is reliable, robust, maintainable, testable, and can scale beyond a single server requires a bit of extra thought and effort. Express applications that need to survive in a production environment will need to reach out to the Node ecosystem and beyond, for support.

    You will start by laying the foundations of your software development journey, as you drive-out features under test. You will move on quickly to expand on your existing knowledge, learning how to create a web API and a consuming client. You will then introduce a real-time element in your application.

    Following on from this, you will begin a process of incrementally improving your application as you tackle security, introduce SSL support, and how to handle security vulnerabilities. Next, the book will take you through the process of scaling and then decoupling your application. Finally, you will take a look at various ways you can improve your application's performance and reliability.

    Table of Contents

    1. Advanced Express Web Application Development
      1. Table of Contents
      2. Advanced Express Web Application Development
      3. Credits
      4. About the Author
      5. About the Reviewers
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Foundations
        1. Feature set
        2. Installation
        3. package.json
        4. Testing Express with Mocha and SuperTest
        5. Feature: Heartbeat
        6. Continuous testing with Mocha
        7. Code coverage with Mocha and JSCoverage
        8. Configuring Express with Nconf
        9. Extracting routes
        10. 404 handling middleware
        11. Logging middleware
        12. Logging with Winston
        13. Task automation with Grunt
        14. Summary
      9. 2. Building a Web API
        1. Persisting data with MongoDB and Mongoose
        2. GitHub tokens
        3. Feature: Create a project
        4. Feature: Get a project
        5. Feature: Edit a project
        6. Feature: Delete a project
        7. Feature: List projects
        8. GitHub API
        9. Feature: List repositories
        10. Feature: List commits
        11. Feature: List issues
        12. Validating parameters with param middleware
        13. Route improvements
        14. Summary
      10. 3. Templating
        1. Server-side templating
        2. Feature: Master Page
        3. Package management with Bower
        4. Templates
        5. Client-side development with Backbone.js
        6. Feature: List projects
        7. Feature: List repositories
        8. Feature: Create a project
        9. Feature: Edit a project
        10. Feature: Delete a project
        11. Feature: List commits
        12. Feature: List issues
        13. Summary
      11. 4. Real-time Communication
        1. Caching data with Redis
        2. Populating Redis
        3. Socket.IO
        4. Socket.IO on the client
        5. Scheduling Redis population
        6. Summary
      12. 5. Security
        1. Setting up Passport
        2. Acceptance testing with Cucumber and Zombie.js
        3. Feature: Authentication
          1. Scenario: User logs in successfully
          2. Scenario: User logs out successfully
        4. Securing our site with HTTPS
        5. Sharing Express sessions with Socket.IO
        6. Cross-site request forgery
        7. Improving security with HTTP headers and helmet
        8. Summary
      13. 6. Scaling
        1. Scaling Express sessions with Redis
        2. Scaling Socket.IO with Redis
        3. Scaling Express horizontally
          1. vision-core
          2. vision-api
          3. vision-worker
          4. vision-web
        4. Vertical scale with Cluster
        5. Balancing load with Hipache
        6. Summary
      14. 7. Production
        1. Error handling, domains, and crash-only design
        2. Redis sessions
        3. SSL termination
        4. Caching
        5. Favicon
          1. Minification
        6. Compression
        7. Logging
        8. Summary
      15. Index