@martel/micro-cookie
v1.2.0
Published
Parses out cookies in micro requests and populates req.cookies
Downloads
2
Readme
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)
})))