Express Web Application Development

Express Web Application Development

Read it now on the O’Reilly learning platform with a 10-day free trial.

O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Book description

Here’s a comprehensive guide to making the most of Express’s flexibility in building web applications. With lots of screenshots and examples, it’s the perfect step-by-step manual for those with an intermediate knowledge of JavaScript.

Express is a minimal and flexible node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications. It provides a thin layer of features fundamental to any web application, without obscuring features that developers know and love in node.js.

"Express Web Application Development" is a comprehensive guide for those looking to learn how to use the Express web framework for web application development.

Starting with the initial setup of the Express web framework, "Express Web Application Development" helps you to understand the fundamentals of the framework. By the end of "Express Web Application Development", you will have acquired enough knowledge and skills to create production-ready Express apps. All of this is made possible by the incremental introduction of more advanced topics, starting from the very essentials.

On the way to mastering Express for application development, we teach you the more advanced topics such as routes, views, middleware, forms, sessions, cookies and various other aspects of configuring an Express application. Jade; the recommended HTML template engine, and Stylus; the CSS pre-processor for Express, are covered in detail.

Last, but definitely not least, Express Web Application Development also covers practices and setups that are required to make Express apps production-ready.

Show and hide more Table of contents Product information

Table of contents

  1. Express Web Application Development
    1. Table of Contents
    2. Express Web Application Development
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Downloading the example code
        7. Customer support
          1. Errata
          2. Piracy
          3. Questions
          1. What is Express?
            1. The story of Express
            1. The application object
            2. The request object
            3. The response object
            1. Asynchronous JavaScript
            2. Node modules
            3. Express apps are Node modules
            4. Middlewares
            5. Request flow
            6. Node HTTP/HTTPS API
            1. Your first Express app
              1. The Express manifest file
              2. A very basic Express app
                1. Starting and stopping the app
                2. Analyzing the output
                1. What are Routes?
                  1. A quick introduction to HTTP verbs
                  1. Route identifiers
                  2. Order of route precedence
                  1. Using Node modules
                  2. Namespaced routing
                  3. Resourceful routing
                  4. Making a choice
                  1. A primer on HTTP response
                    1. HTTP status codes
                      1. 1xx
                      2. 2xx
                      3. 3xx
                      4. 4xx
                      5. 5xx
                      1. Setting the HTTP status code
                      2. Setting HTTP headers
                      3. Sending data
                        1. Plain text
                        2. HTML
                        3. JSON
                        4. JSONP
                        5. Serving static files
                        6. Serving files programmatically
                        7. Serving error pages
                        8. Content negotiation
                        9. Redirecting a request
                        1. What is Jade?
                        2. Generating HTML tags
                          1. Hierarchy of HTML elements
                          2. Assigning IDs
                          3. Assigning classes
                          4. Specifying HTML attributes
                          1. Variables
                          2. Interpolation
                          3. Control structures
                            1. JavaScript constructs
                            2. Jade constructs
                              1. if, else if, and else
                              2. for
                              3. each
                              4. while
                              5. unless
                              6. case
                              1. Includes
                              2. Template inheritance
                              3. Mixins
                              1. Introduction
                              2. Enabling Stylus in Express
                              3. Selectors
                                1. Selector blocks
                                2. Hierarchy
                                1. @import
                                2. @media
                                3. @font-face
                                4. @keyframes
                                5. @extend
                                6. @css
                                1. Variables
                                  1. Literals
                                  2. Lists
                                  3. Tuples
                                    1. Listed tuples
                                    1. if, else if, and else
                                    2. unless
                                    1. Using forms to submit data
                                      1. Handling GET submissions
                                        1. Reading form data
                                        2. Reading URL query parameters
                                        3. Handling multiple options
                                        1. Enabling POST data parsing
                                        2. Reading form data
                                        3. Handling text-only forms
                                        4. Handling file uploads
                                        5. More about file uploads
                                        1. Reading data
                                        1. Creating cookies
                                        2. Reading cookies
                                        3. Updating cookies
                                        4. Session cookies
                                        5. Signed cookies
                                        6. Deleting cookies
                                        1. Cookie-based sessions
                                        2. Session store-based sessions
                                          1. MemoryStore
                                          2. RedisStore
                                          3. MongoStore
                                          1. Setting session variables
                                          2. Reading session variables
                                          3. Updating session variables
                                          4. Deleting session variables
                                          1. Deleting a cookie-based session
                                          2. Deleting a session store-based session
                                          1. What the is production environment?
                                            1. What changes in production mode?
                                            2. Simulating production environment
                                            1. Closing the server
                                            2. Handling uncaught errors
                                              1. Using try-catch to catch uncaught errors
                                              2. Using domains to handle uncaught errors
                                              3. What to do in case of uncaught errors – to terminate the process or not to terminate?
                                              1. Forever
                                              2. Upstart
                                              1. The trust proxy option
                                              Show and hide more

                                              Product information

                                              • Title: Express Web Application Development
                                              • Author(s): Hage Yaapa
                                              • Release date: June 2013
                                              • Publisher(s): Packt Publishing
                                              • ISBN: 9781849696548