Express middleware that automatically generates REST API endpoints for Mongoose models. Version 3.0.7 is stable but has not seen updates since 2016. It provides CRUD routes (GET, POST, PUT, DELETE) with optional view rendering and interceptors. Compared to alternatives like express-restify-mongoose, it is simpler but less configurable and no longer actively maintained.
npm install mongo-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a basic Express app with mongo-rest exposing REST endpoints for a User model.
Migrate to a maintained library or implement REST endpoints manually.
Ensure you pass (app, options) to the constructor.
Pass a model (result of mongoose.model('Name', schema)).Pass urlPath option, e.g., new MongoRest(app, { urlPath: '/api/' }).Ignore README version references; use npm published version.
new MongoRest(app, options) where app is from express()
npm install mongo-rest@3.0.7
Use: const mongoRest = new MongoRest(app); mongoRest.addResource(...)