Содержание
- Cover; Title Page; Copyright and Credits; Dedication; About Packt; Foreword; Contributors; Table of Contents; Preface; Section 1: Unraveling API Design; Chapter 1: 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; Chapter 2: Principles of Designing RESTful APIs
- Technical requirementsOrganizing 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; Summary; Questions; Further reading; Chapter 3: Designing RESTful APIs with OpenAPI and Swagger; Technical requirements; API-first concepts; The OpenAPI Specification; Format
- Document structureData 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; Summary; Questions; Further reading; Section 2: Developing RESTful Web Services; Chapter 4: Setting Up Your Development Environment; Technical requirements; 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 suitesMocha and Chai; Stryker; Debugging; Building tasks for coding; Summary; Questions; Further reading; Chapter 5: Building Your First API; Technical requirements; Serving the app; Initial configurations and file structure; Defining and controlling basic routes; Testing with Postman; Summary; Questions; Further reading; Chapter 6: Handling Requests and Responses; Technical requirements; Creating resource URIs; Creating models; Creating tests for the missing routes; Implementing controllers; Configuring the remaining routes ; Running the application
- Query strings, data filtering, and paginationQuery strings and data filtering; Pagination; Summary; Questions; Further reading; Chapter 7: Formatting the API -- Output; Technical requirements; Content negotiation; Data serialization; Hypertext Application Language; Summary; Questions; Further reading; Section 3: Enhancing RESTful Web Services; Chapter 8: Working with Databases and ODMs; Technical requirements; Using MongoDB; Installing MongoDB; MongoDB with Docker; Installing Docker ; Running MongoDB on Docker; Robomongo ; Setting up order-api with Mongo; Configuring Mongoose