A pure JS client for interacting with server-side RESTful resources. Think Restangular without Angular. All examples written in this README use the ES6 specification. The dist folder contains two built versions which you can use to include either restful.js or a standalone version. Standalone version already embeds fetch. Restful.js needs an HTTP backend in order to perform queries. A custom endpoint acts like a member, and therefore you can use one and all to chain another endpoint with it. Once you have collections and members endpoints, fetch them to get entities. Restful.js exposes get() and getAll() methods for fetching endpoints. Since these methods are asynchronous, they return a native Promise for response. A response is made from the HTTP response fetched from the endpoint. It exposes statusCode(), headers(), and body() methods. For a GET request, the body method will return one or an array of entities. Therefore you can disable this hydration by calling body(false).

Features

  • All examples written in this README use the ES6 specification
  • Create a resource targeting your API
  • Two http backend are currently available
  • Use restful.js in a browser
  • Use restful.js in Node.js
  • Collections and Members endpoints

Project Samples

Project Activity

See All Activity >

Categories

Front-Ends

License

MIT License

Follow restful.js

restful.js Web Site

Other Useful Business Software
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of restful.js!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Front-Ends

Registered

2022-12-07