Package Exports
- admin-panel
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (admin-panel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
NOT FOR PRODUCTION!!!
Requirements:
Your app must use own
bodyParser,cookieParser,session,postNormalize:app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(cookieParser()); app.use(session({ secret: config.get('sessionSecret'), resave: true, saveUninitialized: false, store: sessionStore })); app.use(postNormalize);Where
postNormalizemust parsemultipart/form-datarequest body and populatereq.bodyandreq.filesproperties.Your app must pass session to
res.locals.session:app.use(function(req, res, next) { res.locals.session = req.session; next(); });Your app must use Jade view engine:
app.set('view engine', 'jade');
Installation:
Install package:
npm install admin-panel --saveCreate
admin-config.jsand describe your models.Setup:
var express = require('express'), models = require('./models'), adminConfig = require('./admin-config.js'), adminPanel = require('admin-panel')({ express: express, models: models, adminConfig: adminConfig, storagePath: path.join(__dirname, '../..', 'public/storage') }); router.use('/admin', adminPanel);Examples of
modelsandadmin-config.jsinexamples/folder.