2.0.7 • Published 6 years ago

@zdigital/middlewares v2.0.7

Weekly downloads
24
License
MIT
Repository
-
Last release
6 years ago

@zdigital/middlewares

npm.io

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

MIT © Zona Digital

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.1-y.0

6 years ago

2.0.1-alpha.12

6 years ago

2.0.1-alpha.11

6 years ago

2.0.1-alpha.10

6 years ago

2.0.1-alpha.9

6 years ago

2.0.1-alpha.8

6 years ago

2.0.1-alpha.7

6 years ago

2.0.1-alpha.6

6 years ago

2.0.1-alpha.5

6 years ago

2.0.1-alpha.3

6 years ago

2.0.1-alpha.2

6 years ago

2.0.1-alpha.1

6 years ago

2.0.1-alpha.0

6 years ago

0.0.1-alpha.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago