Express Route Keeper
Important! This project is in development, README.md is draft API.
This project is a route middleware for acls and parameter checker.
Installation
npm i express-route-keeper
Usage
;;; const app = ;const keeper = ; const READ_PROJECT = Symbol'READ_PROJECT';const CREATE_PROJECT = Symbol'CREATE_PROJECT';const PROJECT_MASTER = Symbol'PROJECT_MASTER'; // middleware for request body parseapp;app; // acl role injectionapp; // public routeapp; // acl routeapp;app; // AND match // parameter checkerapp; // mixed modeapp; app;
ACL OR match
app;
Working with other middleware
// General Usage// Check ACL before uploaded file handlerapp; // Body field checker with multipartapp;
Set custom exception
; const keeper = ;
Action Keys
You can use String or ES6 Symbol (Recommend) for action keys.
Querystring or Body
If request method is GET, check the querystring in req.query
or check parameters in req.body
.