Skip to content

zakjholt/micro-cookie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micro-cookie

cookie parser for zeit's micro

Parses request cookies and puts the object in req.cookies

Installation

yarn add micro-cookie

Usage

const parseCookies = require('micro-cookie')

module.exports = parseCookies(async function(req, res) {
  return 'Hello World!'
})

With other micro plugins

const visualize = require('micro-visualize')
const cors = require('micro-cors')
const cookieParse = require('micro-cookie')
const { send } = require('micro')

module.exports = visualize(cors(cookieParse(async function(req, res) {
  const responseMessage = {
    message: 'hello world!',
    cookies: req.cookies
  }
  send(res, 200, responseMessage)
})))

About

A package to parse out request cookies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published