A Bedrock module that adds helpers for REST support, including resource handlers, ID parameter validation, and content negotiation for JSON, JSON-LD, and HTML requests. Version 3.0.0 is the latest stable release, compatible with Bedrock 1.x-3.x and Node.js >=8. It provides middleware like makeResourceHandler and idParam for express-based applications. Differentiators include tight integration with the Bedrock ecosystem and automatic type negotiation.
npm install bedrock-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a REST endpoint with Bedrock-Express using idParam and makeResourceHandler.
Always pass an options object, e.g., makeResourceHandler({}) or with get property.Use with bedrock-express and the 'bedrock-express.init' event.
Use makeResourceHandler directly.
Set options.json false or options.html false if not needed.
Run: npm install bedrock-rest
Use require('bedrock-rest') and destructure: const { idParam } = require('bedrock-rest');Change port in config or kill existing process: lsof -ti:80 | xargs kill