Connect a DefineMap to a RESTful API endpoint. Version 2.0.0 is the latest stable release of this CanJS plugin. It provides a declarative way to define REST models using can-define and can-connect. The package is actively maintained by Bitovi and follows CanJS's release cadence. Unlike raw can-connect, it integrates tightly with can-define's property definitions and provides automatic CRUD methods.
npm install can-define-rest-modelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates defining a RESTful model with Todo list using can-define-rest-model, including CRUD URL configuration and getList usage.
Ensure your DefineMap has an identity property: id: { type: 'number', identity: true }.Change import from import { restModel } from 'can-define-rest-model' to import defineRestModel from 'can-define-rest-model'.Explicitly define all CRUD aliases or ensure the defaults match your API endpoints.
Ensure you import defineRestModel correctly and pass a config object with url property.
Add an identity property, e.g., id: { type: 'number', identity: true }.Install can-define: npm install can-define. Ensure import path matches.