amdin
v0.5.1
Published
A plug-and-play admin for [Mongoose](http://mongoosejs.com), written with [Koa](http://koajs.com) and [Vue](https://vuejs.org).
Downloads
18
Maintainers
Readme
Amdin
A plug-and-play admin for Mongoose, written with Koa and Vue.
npm i --save amdin mongoose koa
const Koa = require('koa'),
mongoose = require('mongoose'),
admin = require('amdin')
mongoose.connect('mongodb://localhost/amdin')
mongoose.model('Book', {
title: String,
summery: { type: String, field: 'textarea' }
})
const app = new Koa
app.use(admin())
app.use(ctx => {
ctx.redirect('/admin/')
})
app.listen(3000, () => {
console.log('running on http://localhost:' + 3000)
})