2.0.7 • Published 5 years ago
@zdigital/middlewares v2.0.7
@zdigital/middlewares
Middleware collection for Express applications.
Install
$ npm i @zdigital/middlewares --save
Library
withAlerts
withAuth
withLocale
withModules
withSEO
withState
withStore
Usage
const {
withAlerts,
withAuth,
withLocale,
withModules,
withSEO,
withState,
withStore,
} = require('@zdigital/middlewares');
const withLocaleMap = {
en: require('./locale/en.json'),
pt: require('./locale/pt.json'),
es: require('./locale/es.json'),
it: require('./locale/it.json'),
de: require('./locale/de.json'),
};
const withLocaleOptions = {
isWebsiteLocalized: true,
defaultLocale: 'en',
supportedLocales: Object.keys(withLocaleMap),
};
const { state } = require('@zdigital/core');
app.get('*', [
withAlerts,
withAuth,
withLocale(withLocaleMap, withLocaleOptions),
withModules,
withSEO,
withState(state),
withStore(require('./../path/to/store')),
], (req, res, next) => next());
License
2.0.7
5 years ago
2.0.6
5 years ago
2.0.5
5 years ago
2.0.4
5 years ago
2.0.3
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.1-y.0
5 years ago
2.0.1-alpha.12
5 years ago
2.0.1-alpha.11
5 years ago
2.0.1-alpha.10
5 years ago
2.0.1-alpha.9
5 years ago
2.0.1-alpha.8
5 years ago
2.0.1-alpha.7
5 years ago
2.0.1-alpha.6
5 years ago
2.0.1-alpha.5
5 years ago
2.0.1-alpha.3
5 years ago
2.0.1-alpha.2
5 years ago
2.0.1-alpha.1
5 years ago
2.0.1-alpha.0
5 years ago
0.0.1-alpha.0
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago