Skip to content

LiShiSangZi/egg-session-memcached

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

egg-session-memcached

Session extension for store the session data in memcached.

Install

$ npm i egg-session-memcached --save

Usage

// {app_root}/app.js
// If you want to use session in your middleware. You need to add it after session middleware.
const index = app.config.coreMiddleware.indexOf('session');
if (index >= 0) {
  app.config.coreMiddleware.splice(index + 1, 0, MyMiddleware);
}
// {app_root}/config/plugin.js
exports['session-memcached'] = {
  enable: true,
  package: 'egg-session-memcached'
};

Configuration

// {app_root}/config/config.default.js 
exports['session-memcached'] = {
  client: {
    host: `${YOUR_MEMCACHED_HOST}`,
    port: `${YOUR_MEMCACHED_PORT}`,
    failOverServers: [] // Your memcached fail over servers. Including the port and host.
  }
};

About

Memcached session plugin for egg.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published