Manage and understand the full capabilities of successful REST development. REST API development is a hot topic in the programming world, but not many resources exist for developers to really understand how you can leverage the advantages.
This completely updated second edition provides a brief background on REST and the tools it provides (well known and not so well known), then explains how there is more to REST than just JSON and URLs. You will learn about the maintained modules currently available in the npm community, including Express, Restify, Vatican, and Swagger. Finally you will code an example API from start to finish, using a subset of the tools covered.
The Node community is currently flooded with modules; some of them are published once and never updated again - cluttering the entire universe of packages. Pro REST API Development with Node.js shines light into that black hole of modules for the developers trying to create an API. Understand REST API development with Node.js using this book today.
What You'll Learn
Understand how REST and API development mix up with Node.js
Create a scalable, technology agnostic, and uniform interface Prepare your services to be consumed by your clients
Test and deploy your API
Review troubleshooting techniques
Who This Book Is For
Any Node.js developer who wants to fully understand REST API development.
Beginner and Intermediate Node.js developers who are looking to fully understand how to create RESTful microservices.
About the Author |
|
xi | |
About the Technical Reviewer |
|
xiii | |
Acknowledgments |
|
xv | |
Introduction |
|
xvii | |
|
|
1 | (38) |
|
|
2 | (2) |
|
|
4 | (7) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
7 | (2) |
|
|
9 | (1) |
|
|
10 | (1) |
|
Resources, Resources, Resources |
|
|
11 | (15) |
|
|
11 | (3) |
|
|
14 | (1) |
|
|
15 | (5) |
|
Hypermedia in the Response and Main Entry Point |
|
|
20 | (6) |
|
|
26 | (2) |
|
|
28 | (9) |
|
|
37 | (2) |
|
Chapter 2 API Design Best Practices |
|
|
39 | (32) |
|
|
39 | (1) |
|
|
40 | (6) |
|
|
40 | (1) |
|
Easy-to-Remember Access Points |
|
|
41 | (1) |
|
|
42 | (4) |
|
|
46 | (4) |
|
How Is Extensibility Managed? |
|
|
46 | (4) |
|
|
50 | (3) |
|
|
53 | (3) |
|
Phase 1 Development of the Client |
|
|
53 | (2) |
|
Phase 2 The Client Is Implemented and Being Used by End Users |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
57 | (9) |
|
|
58 | (8) |
|
|
66 | (4) |
|
|
70 | (1) |
|
Chapter 3 Node.js and REST |
|
|
71 | (30) |
|
|
72 | (9) |
|
|
76 | (5) |
|
|
81 | (6) |
|
|
85 | (2) |
|
|
87 | (9) |
|
|
88 | (1) |
|
Object-Oriented Programming Simplified |
|
|
89 | (2) |
|
The new Class construct from ES6 |
|
|
91 | (2) |
|
Functional Programming Support |
|
|
93 | (1) |
|
|
94 | (1) |
|
|
95 | (1) |
|
Npm: The Node Package Manager |
|
|
96 | (2) |
|
|
98 | (1) |
|
|
99 | (2) |
|
Chapter 4 Architecting a REST API |
|
|
101 | (20) |
|
The Request Handler, the Pre-Process Chain, and the Routes Handler |
|
|
102 | (5) |
|
MVC: a.k.a. Model-View-Controller |
|
|
107 | (9) |
|
|
112 | (4) |
|
|
116 | (3) |
|
|
119 | (2) |
|
Chapter 5 Working with Modules |
|
|
121 | (52) |
|
|
122 | (50) |
|
Request/Response Handling |
|
|
122 | (1) |
|
|
122 | (1) |
|
|
123 | (2) |
|
|
125 | (1) |
|
Hypermedia on the Response |
|
|
125 | (1) |
|
Response and Request Validation |
|
|
125 | (1) |
|
|
125 | (47) |
|
|
172 | (1) |
|
Chapter 6 Planning Your REST API |
|
|
173 | (18) |
|
|
173 | (16) |
|
|
177 | (11) |
|
Choosing the Right Modules for the Job |
|
|
188 | (1) |
|
|
189 | (2) |
|
Chapter 7 Developing Your REST API |
|
|
191 | (70) |
|
Minor Changes to the Plan |
|
|
192 | (2) |
|
Simplification of the Store-Employee Relationship |
|
|
192 | (1) |
|
|
192 | (1) |
|
|
193 | (1) |
|
A Small Backdoor for Swagger |
|
|
193 | (1) |
|
|
194 | (1) |
|
|
194 | (2) |
|
|
196 | (63) |
|
|
197 | (1) |
|
|
197 | (31) |
|
|
228 | (9) |
|
|
237 | (6) |
|
|
243 | (2) |
|
|
245 | (9) |
|
|
254 | (1) |
|
|
255 | (4) |
|
|
259 | (2) |
|
Chapter 8 Testing your API |
|
|
261 | (22) |
|
|
261 | (11) |
|
|
261 | (3) |
|
|
264 | (7) |
|
|
271 | (1) |
|
|
272 | (10) |
|
|
272 | (3) |
|
|
275 | (7) |
|
|
282 | (1) |
|
Chapter 9 Deploying into Production |
|
|
283 | (20) |
|
|
283 | (8) |
|
The Classical Development Workflow |
|
|
283 | (3) |
|
Tips for Your Production Environment |
|
|
286 | (5) |
|
Doing the Actual Deployment |
|
|
291 | (11) |
|
|
292 | (3) |
|
What about Continuous Integration? |
|
|
295 | (1) |
|
|
296 | (6) |
|
|
302 | (1) |
|
Chapter 10 Troubleshooting |
|
|
303 | (12) |
|
|
303 | (5) |
|
The Controllers Action's Code |
|
|
304 | (2) |
|
|
306 | (2) |
|
Issues Configuring the Swagger UI |
|
|
308 | (2) |
|
CORS: a.k.a. Cross-Origin Resource Sharing |
|
|
310 | (4) |
|
|
314 | (1) |
Index |
|
315 | |
Fernando Doglio has been working as a Web Developer for the past 10 years. In that time, he's come to love the web, and has had the opportunity of working with most of the leading technologies at the time, suchs as PHP, Ruby on Rails, MySQL, and Node. js, Angular.js, AJAX, REST APIs and others. In his spare time, he likes to tinker and learn new things, which is why his Github account keeps getting new repos every month. He's also a big Open Source supporter, trying to convert new people into it. He can be contacted on twitter at: @deleteman123. When not programming, he can be seen spending time with his family.