Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wxs77577/adonis-crud-api
Crud API based on adonis-rest and adminify for AdonisJs
https://github.com/wxs77577/adonis-crud-api
admin adonisjs api crud nodejs
Last synced: about 3 hours ago
JSON representation
Crud API based on adonis-rest and adminify for AdonisJs
- Host: GitHub
- URL: https://github.com/wxs77577/adonis-crud-api
- Owner: wxs77577
- License: apache-2.0
- Created: 2017-06-14T02:59:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-14T15:55:30.000Z (over 7 years ago)
- Last Synced: 2024-11-10T20:52:28.790Z (5 days ago)
- Topics: admin, adonisjs, api, crud, nodejs
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# adonis-crud-api
CRUD restful api for [AdonisJs](http://www.adonisjs.com/) and [Adminify](https://github.com/wxs77577/adminify), the key is the `grid` and `form` routes. Based on [Adonis Rest](https://github.com/wxs77577/adonis-rest)### Welcome to [https://adonis-china.org](https://adonis-china.org)
## [中文文档](README_CN.md)
## Screenshots
### Grid
![file](https://adonis-china.org/uploads/post-body-1497455501361.png)### Form
![file](https://adonis-china.org/uploads/post-body-1497455572312.png)## Install
1. `npm install --save adonis-crud-api`
## Prepare
### Add routes to your `/app/Http/routes.js`
``` javascript
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```` javascript
'use strict'const BaseRestController = require('adonis-crud-api')
class CrudController extends BaseRestController{
}
module.exports = CrudController
```## That's all
## Routes
- Please check [Adonis Rest](https://github.com/wxs77577/adonis-rest) for basic CRUD routes
- `/api/:resource/grid` Get grid configurations for [Adminify](https://github.com/wxs77577/adminify) or your own frontend frameworks.
- `/api/:resource/form` Get form configurations for [Adminify](https://github.com/wxs77577/adminify) or your own frontend frameworks.