mongoose-express-crud

0.0.3 • Public • Published

mongoose-crud

Enable all CRUD(Create, Read, Update, and Delete) endpoints with this express middleware.

Features

  • Creates endpoints for Get Post, Update, and Delete
  • Enables query strings for Get

Install

$ npm install mongoose-crud --save

API

import Crud from 'mongoose-crud';

new Crud(Mongoose Model);

const crud = new Crud(MongooseModel);

Example

import Crud from 'mongoose-express-crud';
import express from 'express';
import User from './models/User'; //Model for endpoints

const crud = new Crud(User);

const app = express();

app.use('/users', crud.routes)

app.listen(3000, () => {
  console.log('App listening on port 3000!')
});

note: If using require() you must add .default

var Crud = require('mongoose-crud').default

Package Sidebar

Install

npm i mongoose-express-crud

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • blazingsolutions