Resource plugin
A comments plugin built with defineResourcePlugin that attaches a typed comments namespace and CRUD routes to a parent resource.
- Plugins
- CRUD
- SQLite
1 services · 8 actions · 2 tables · 9 files
Features
- defineResourcePlugin and resource extensions
- Write hooks that trim and validate input
- Compiled HTTP routes for list, count, update and delete
Service graph
Actions and routes
pages
| Method | Path | Action | Access |
|---|---|---|---|
| POST | /api/pageComment/query | pageComment.list | public |
| GET | /api/pageComment/:id | pageComment.get | public |
| POST | /api/pageComment | pageComment.create | public |
| PATCH | /api/pageComment/:id | pageComment.update | public |
| DELETE | /api/pageComment/:id | pageComment.delete | public |
| POST | /api/pageComment/find-one | pageComment.findOne | public |
| POST | /api/pageComment/count | pageComment.count | public |
| POST | /api/pageComment/exists | pageComment.exists | public |
Database tables
| id | text | PK |
|---|
| id | text | PK |
|---|---|---|
| target_id | text | NOT NULL |
| body | text | NOT NULL |
Source
Loading source…
Run it
The server listens on port 3001.