node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »



Restful with mongodb + koa ❤️

Pdta: ECHO (Elian Chancay Olivo is my Son 👶 It's funny because I do not like php )

Developing ... 🏃

version downloads slack


How to use

  import koa          from 'koa';
  import mongoose     from 'mongoose';
  import echoApi      from 'echo-crud';
  const app = koa();
  const mongoUrl = 'mongodb://localhost/yourDatabase';
  let schema = new mongoose.Schema({
    name: String,
    age : Number
  }, {versionKey: false});
  const model = app.model = mongoose.model('user', schema);
  const user = echoApi(app, model,['GET','POST','PUT','DELETE']);

Use header X-Requested-With : XMLHttpRequest

test in your browser. http://localhost:3000/users

-- Params query body
GET limit - skip - sort ---
GET id limit - skip - sort ---
POST --- --- Json data
DELETE id* --- ---
PUT id* --- Json data

Bitdeli Badge