universal-cookie-express
TypeScript icon, indicating that this package has built-in type declarations

8.0.1 • Public • Published

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

import express, { Request, Response } from 'express';
import cookiesMiddleware from 'universal-cookie-express';

const app = express();

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

Package Sidebar

Install

npm i universal-cookie-express

Weekly Downloads

29,270

Version

8.0.1

License

MIT

Unpacked Size

5.58 kB

Total Files

7

Last publish

Collaborators

  • exon