express-dashboard
v0.0.2
Published
a middleware providing dashboard, free to modify variables and control everything in the program.
Downloads
1
Readme
Express Dashboard Middleware
A middleware providing dashboard, free to modify variables and control everything in the program.
I. Preview
I. How to use
// import module
const dashboard = require('express-dashboard')
// ...
const app = express();
// *It is required*
app.use(bodyParser.json())
app.use(new dashboard({...}));
app.listen(PROT);
I. What it provides me
DataProvider (default: redis)
You can customize the data source according to your own needs and monitor the data changes.
SafeSessions (default: MemorySessions and 2fa auth)
You can be used to customize the sessions logic and let the dashboard log in your way.
defalut (express-dashboard)
The following api will be provided:
GET /dashboard
-> render dashboard pageGET /dashboard/items
-> will returnDataProvider.getItems
POST /dashboard/items
-> useDataProvider.setItems
change item valuePOST /dashboard/verify
-> useSafeSessions.verifyAuth
andSafeSessions.newCookie
to generate a new session
It's worth saying that you can customize the path
options.dashboardUrl
I. Update Version
- [x] 0.0.2 add session expires display.