adonis-crud-api
v1.0.2
Published
CRUD Restful api for AdonisJs and Adminify
Downloads
6
Readme
adonis-crud-api
CRUD restful api for AdonisJs and Adminify, the key is the grid
and form
routes. Based on Adonis Rest
Welcome to https://adonis-china.org
中文文档
Screenshots
Grid
Form
Install
npm install --save adonis-crud-api
Prepare
Add routes to your /app/Http/routes.js
Route.put('/api/:resource', 'CrudController.update') //optional
Route.get('/api/:resource/grid', 'CrudController.grid') //the grid configurations for the list grid view
Route.get('/api/:resource/form', 'CrudController.form') //the form configurations for create
Route.get('/api/:resource/:id/form', 'CrudController.form') // the form configurations for edit
Route.resource('/api/:resource', 'CrudController') //CRUD for resources
Route.resource('/api/:parent/:parentId/:resource', 'CrudController') //CRUD for netsted resource (In Progress...)
Create /app/Http/Controllers/CrudController.js
'use strict'
const BaseRestController = require('adonis-crud-api')
class CrudController extends BaseRestController{
}
module.exports = CrudController
That's all
Routes
- Please check Adonis Rest for basic CRUD routes
/api/:resource/grid
Get grid configurations for Adminify or your own frontend frameworks./api/:resource/form
Get form configurations for Adminify or your own frontend frameworks.