▶Book Description
When building RESTful services, it is really important to choose the right framework. Node.js, with its asynchronous, event-driven architecture, is exactly the right choice for building RESTful APIs.
This third edition of RESTful Web API Design with Node.js 10 will teach you to create scalable and rich RESTful applications based on the Node.js platform. You will be introduced to the latest NPM package handler and understand how to use it to customize your RESTful development process. You will begin by understanding the key principle that makes an HTTP application a RESTful-enabled application. After writing a simple HTTP request handler, you will create and test Node.js modules using automated tests and mock objects; explore using the NoSQL database, MongoDB, to store data; and get to grips with using self-descriptive URLs. You'll learn to set accurate HTTP status codes along with understanding how to keep your applications backward-compatible. Also, while implementing a full-fledged RESTful service, you will use Swagger to document the API and implement automation tests for a REST-enabled endpoint with Mocha. Lastly, you will explore some authentication techniques to secure your application.
▶What You Will Learn
⦁ Install, develop, and test your own Node.js user modules
⦁ Understand the differences between HTTP and RESTful applications
⦁ Use self-descriptive URLs and set accurate HTTP status codes
⦁ Eliminate third-party dependencies in your tests with mocking
⦁ Implement automation tests for a REST-enabled endpoint with Mocha
⦁ Secure your services with NoSQL database integration within Node.js applications
⦁ Integrate a simple frontend using JavaScript libraries available on a CDN server
▶Key Features
⦁ Create rich and scalable RESTful API solutions from scratch
⦁ Explore the new features of Node.js 10, Express 4.0, and MongoDB
⦁ Integrate MongoDB in your Node.js application to store and secure your data
▶Who This Book Is For
This book targets developers who want to enrich their development skills by learning how to develop scalable, server-side, RESTful applications based on the Node.js platform. You also need to be aware of HTTP communication concepts and should have a working knowledge of the JavaScript language. Keep in mind that this is not a book that will teach you how to program in JavaScript. Knowledge of REST will be an added advantage but is definitely not a necessity.
▶What this book covers
⦁ Chapter 1, REST –. What You Did Not Know, gives you a brief introduction to the history of REST and how it couples with the HTTP protocol.
⦁ Chapter 2, Getting Started with Node.js, teaches you how to install Node.js and how to work with its package manager to install modules. You'll also develop your first HTTP server application and write automated unit tests for HTTP handler using mock request objects.
⦁ Chapter 3, Building a Typical Web API, takes you through structuring your application using human-readable URL and URI parameters. You will get to develop a read-only RESTful service application, using the filesystem for storage.
⦁ Chapter 4, Using NoSQL Databases, showcases how to use the MongoDB NoSQL database, and explains the foundation of document data stores.
⦁ Chapter 5, Restful API Design Guidelines, explains that there are a number of prerequisites that a RESTful API should meet.
⦁ Chapter 6, Implementing a Full-Fledged RESTful Service, focuses on implementing a production-ready RESTful service that uses NoSQL to store its data. You will get to learn how to handle binary data and how to version an API while it evolves.
⦁ Chapter 7, Preparing a RESTful API for Production, explains that feature complete and fullfledged implementations aren't necessarily production-ready.
⦁ Chapter 8, Consuming a RESTful API, showcases a sample frontend client that serves as a consumption reference implementation.
⦁ Chapter 9, Securing the Application, covers restricting access to your data by choosing an appropriate authentication approach. You'll then be able to protect data leakage with transport layer security.