Using Express Web Server

Even if a web application is a single-page application (SPA), we will very likely need a backend web server to serve the SPA files and secure API services for our SPA. In this chapter, we will examine recipes to set up an Express.js web server as the backend for our MEAN stack web application. We will cover how to add routing for our server and serve our Angular application and other common backend needs, such as logging and handling cookies.

In this chapter, we will cover the following recipes:

  • Creating a new Express project with express-generator
  • Working with routes in Express
  • Serving an Angular web application with Express
  • Working with headers in Express
  • Working with cookies in Express
  • Creating Express middleware for routes
  • Logging traffic and activity with Morgan
  • Running your Express web server with Forever
  • Securing your Express web server
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.240.58