@furystack/rest

7.0.2 • Public • Published

REST

REST API Model package for FuryStack

Generic concept

An ideal way to implement REST APIs in FuryStack is the following:

  1. Design the REST API - Create an interface that defines all endpoints, all requirements and all possible return values (~this package) You can place in a common module in a Monorepo that can be accessed both with the Backend and Frontend logic to share the API definition
  2. Implement the defined API endpoint using the interface on the backend service (~@furystack/rest-service)
  3. Import the predefined interface and use it on the client (@furystack/rest-client-fetch package)
  4. Be happy. Type safety can protect your ass if you do breaking changes with your REST API

Disclaimer

  1. Your service and client will be tightly coupled. However it can be beneficial if this is intentional but it doesn't fin in all REST API scenarios
  2. Validation doesn't come with type definitions by default - Type safety is compile-time only

Package Sidebar

Install

npm i @furystack/rest

Weekly Downloads

55

Version

7.0.2

License

GPL-2.0

Unpacked Size

56 kB

Total Files

79

Last publish

Collaborators

  • gallayl