Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Node.js Web Development
  • Table Of Contents Toc
Mastering Node.js Web Development

Mastering Node.js Web Development

By : Adam Freeman
4.9 (7)
close
close
Mastering Node.js Web Development

Mastering Node.js Web Development

4.9 (7)
By: Adam Freeman

Overview of this book

Dive into the world of Node.js with this comprehensive guide, taking you from foundational concepts to practical web development mastery. Written by an industry veteran with over 50 programming books under his belt, this book will help both beginners and seasoned developers. Gain a deep understanding of the most important server-side features in web development with Node.js. The first part of the book will get you up to speed with basic features of Node.js and TypeScript. In the second part, you’ll elevate your skills by creating simplified implementations of key server-side features to understand how they work and how they are presented to clients. Armed with the understanding gained from implementing each feature, you will be able to replace custom code with production-ready open-source packages. The third part will help you understand how server-side features are combined for practical web development. Using Adam Freeman’s signature SportsStore application, you will learn how to develop client and server-side components, culminating in a thorough application deployment preparation. By the end of this Node.js book, you will be able to build and deploy server applications to support HTTP clients, including JavaScript applications created with frameworks such as Angular and React.
Table of Contents (26 chapters)
close
close
Lock Free Chapter
1
Putting Node.js in Context
10
Node.js in Detail
18
SportsStore
25
Other Books You May Enjoy
26
Index

Sanitizing form data

It isn’t just files that you should be cautious about receiving from users: any data has the potential to cause problems. The most common problem is a cross-site scripting (XSS) attack where a data value is crafted so that it is interpreted by the browser as HTML elements or JavaScript code. In Chapter 7, I demonstrated how a content security policy can be used to help prevent XSS by telling the browser how the application is expected to behave, but another good measure is to sanitize data that is received from one user so that it doesn’t contain characters that browsers will interpret unexpectedly when it is displayed to another user. To prepare, Listing 11.17 changes the form handler so it returns an HTML response.

Listing 11.17: Returning an HTML response in the forms.ts file in the src/server folder

import express, { Express } from "express";
import multer from "multer";
const fileMiddleware = multer({storage: multer...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Node.js Web Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon