resourcejs | minimalistic Express.js library | REST library
kandi X-RAY | resourcejs Summary
kandi X-RAY | resourcejs Summary
Resource.js - A simple Express library to reflect Mongoose models to a REST interface with a splash of Swagger.io love.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of resourcejs
resourcejs Key Features
resourcejs Examples and Code Snippets
Community Discussions
Trending Discussions on resourcejs
QUESTION
Following step by step a simple installation of resourcejs as documented in this MEAN App repo, I get the following message, when I access the URL http://localhost:3000/movie/584c6f00cf996a9956784807:
{"status":500,"message":"Cast to ObjectId failed for value \"584dd2842a056e4a648751b5\" at path \"_id\" for model \"movie\"","errors":{}}
POST requests work too, but PUT and DELETE do not.
index.js
...ANSWER
Answered 2017-Jan-05 at 01:45Because mongoose wants ObjectId
but You're passing string
as _id
, so You should typecast it.
Try this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install resourcejs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page