Hands-On RESTful Web Services with TypeScript 3
eBook - ePub

Hands-On RESTful Web Services with TypeScript 3

Design and develop scalable RESTful APIs for your applications

  1. 470 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On RESTful Web Services with TypeScript 3

Design and develop scalable RESTful APIs for your applications

Book details
Book preview
Table of contents
Citations

About This Book

A step-by-step guide that will help you design, develop, scale, and deploy RESTful APIs with TypeScript 3 and Node.js

Key Features

  • Gain in-depth knowledge of OpenAPI and Swagger to build scalable web services
  • Explore a variety of test frameworks and test runners such as Stryker, Mocha, and Chai
  • Create a pipeline by Dockerizing your environment using Travis CI, Google Cloud Platform, and GitHub

Book Description

In the world of web development, leveraging data is the key to developing comprehensive applications, and RESTful APIs help you to achieve this systematically. This book will guide you in designing and developing web services with the power of TypeScript 3 and Node.js. You'll design REST APIs using best practices for request handling, validation, authentication, and authorization. You'll also understand how to enhance the capabilities of your APIs with ODMs, databases, models and views, as well as asynchronous callbacks. This book will guide you in securing your environment by testing your services and initiating test automation with different testing approaches. Furthermore, you'll get to grips with developing secure, testable, and more efficient code, and be able to scale and deploy TypeScript 3 and Node.js-powered RESTful APIs on cloud platforms such as the Google Cloud Platform. Finally, the book will help you explore microservices and give you an overview of what GraphQL can allow you to do.

By the end of this book, you will be able to use RESTful web services to create your APIs for mobile and web apps and other platforms.

What you will learn

  • Explore various methods to plan your services in a scalable way
  • Understand how to handle different request types and the response status code
  • Get to grips with securing web services
  • Delve into error handling and logging your web services for improved debugging
  • Uncover the microservices architecture and GraphQL
  • Create automated CI/CD pipelines for release and deployment strategies

Who this book is for

If you're a developer who has a basic understanding of REST concepts and want to learn how to design and develop RESTful APIs, this book is for you. Prior knowledge of TypeScript will help you make the most out of this book.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Hands-On RESTful Web Services with TypeScript 3 by Biharck Muniz Araújo in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Science General. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781789955019
Edition
1

Section 1: Unraveling API Design

In this section, you will gain an understanding of the inner workings of API design. You will also learn best practices for creating APIs and how to plan your APIs for future needs.
The following chapters are included in this section:
  • Chapter 1, Introduction to RESTful Web Service Development
  • Chapter 2, Principles of Designing RESTful APIs
  • Chapter 3, Designing RESTful APIs with OpenAPI and Swagger

Introduction to RESTful API Development

In order to get the best from any technology, it is necessary to understand deeply what the technology does. Throughout this chapter, RESTful concepts will be explained in detail with necessary elements to help you to develop and run RESTful services. The main objective of the chapter is to show you comprehensive examples that transpose these concepts to real-world scenarios and help you to understand their definitions in an easier way.
Currently, there is a huge necessity for applications to scale when necessary; they need to be fast, secure, portable, and trustable. These applications no longer serve one specific purpose; in fact, they work to solve corporative issues and meet the needs of end users.
APIs are the core elements for creating web and mobile applications. They provide structured data for your applications. This chapter mainly focuses on the definition of Representational State Transfer (REST) and RESTful principles, and describes the primary logic behind these architectural principles as well as the standards to follow while creating a web service.
The following topics will be covered in this chapter:
  • The REST definition
  • RESTful styles
  • The general concepts regarding REST
  • HTTP methods and verbs

Technical requirements

There are no requirements for this chapter; this chapter will lay the foundation for what this book is going to cover.

What is REST?

RESTful web services are services built according to REST principles. The idea is to have them designed to essentially work well on the web. Alright, but what is REST? Let's start from the beginning, that is, by defining REST.
The REST style is a set of software engineering practices that contains constraints that should be used in order to create web services in distributed hypermedia systems. REST is not a tool and neither is it a language; in fact, REST is agnostic of protocols, components, and languages.
It is important to say that REST is an architectural style and not a toolkit. REST provides a set of design rules in order to create stateless services that are shown as resources and, in some cases, sources of specific information such as data and functionality. The identification of each resource is performed by its unique Uniform Resource Identifier (URI). REST describes simple interfaces that transmit data over a standardized interface such as HTTP and HTTPS without any additional messaging layer, such as Simple Object Access Protocol (SOAP).
The consumer will access REST resources via a URI using HTTP methods (this will be explained in more detail later). After the request, it is expected that a representation of the requested resource is returned. The representation of any resource is, in general, a document that reflects the current or intended state of the requested resource.

REST architectural styles

The REST architectural style describes six constraints. These constraints were originally described by Roy Fielding in his Ph.D. thesis ( https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm). They include the following:
  • Uniform interface
  • Stateless
  • Cacheable
  • Client-server architectu...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. About Packt
  5. Foreword
  6. Contributors
  7. Preface
  8. Section 1: Unraveling API Design
  9. Introduction to RESTful API Development
  10. Principles of Designing RESTful APIs
  11. Designing RESTful APIs with OpenAPI and Swagger
  12. Section 2: Developing RESTful Web Services
  13. Setting Up Your Development Environment
  14. Building Your First API
  15. Handling Requests and Responses
  16. Formatting the API - Output
  17. Section 3: Enhancing RESTful Web Services
  18. Working with Databases and ODMs
  19. Securing Your API
  20. Error Handling and Logging
  21. Creating a CI/CD Pipeline for Your API
  22. Section 4: Extending the Capabilities of RESTful Web Services
  23. Developing RESTful APIs with Microservices
  24. Flexible APIs with GraphQL
  25. Assessments
  26. Other Books You May Enjoy