JSPM

  • Created
  • Published
  • Downloads 33495
  • Score
    100M100P100Q154674F
  • License MIT

Hook cookies get/set on Express for server-rendering

Package Exports

  • universal-cookie-express
  • universal-cookie-express/cjs/index.js
  • universal-cookie-express/es6/index.js

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 (universal-cookie-express) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

universal-cookie-express

Hook cookies get/set on Express for server-rendering

Integrations

State management integration

Getting started

npm install universal-cookie-express --save

Usage

cookiesMiddleware() express middleware set req.universalCookies

Example

const express = require('express');
const cookiesMiddleware = require('universal-cookie-express');

const app = express();

app.use(cookiesMiddleware()).use(function (req, res) {
  // get the user cookies using universal-cookie
  req.universalCookies.get('myCat');
});