更新时间:2021-07-02 12:20:01
coverpage
Title Page
Copyright and Credits
Hands-On RESTful Web Services with TypeScript 3
Dedication
About Packt
Why subscribe?
Packt.com
Foreword
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Section 1: Unraveling API Design
Introduction to RESTful API Development
Technical requirements
What is REST?
REST architectural styles
Uniform interface
Resource-based
The manipulation of resources using representations
Self-descriptive messages
HATEOAS
Stateless
Cacheable
Client-server architecture
A layered system
Code on demand
HTTP methods for RESTful services
Summary
Questions
Further reading
Principles of Designing RESTful APIs
Organizing API endpoints
Resource-based APIs
Experience-based APIs
Capability-based APIs
Working with large datasets
Pagination
Sorting
Filtering
Naming conventions
Versioning
Including the version in the URL
Versioning in the subdomain
Versioning on media types
Recommendation
HTTP status codes
2xx – success
3xx – redirection
4xx – client error
5xx – server error
Designing RESTful APIs with OpenAPI and Swagger
API-first concepts
The OpenAPI Specification
Format
Document structure
Data types
Design maturity and implementation
Level 0 – The Swamp of POX
Level 1 – Resources
Level 2 – HTTP Verbs
Level 3 – Hypermedia Controls
Swagger tooling
Swagger Editor
Swagger Codegen
The Swagger UI
Section 2: Developing RESTful Web Services
Setting Up Your Development Environment
Installing various web servers
Node.js
npm
Testing Node.js and npm
Express.js
Express installation
First app with Express.js
TypeScript installation
Visual Studio Code
Code Linters
TSLint
Prettier
Testing suites