1.2.0 • Published 7 years ago

koa-uuid v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

koa-uuid

NPM version github location Build status Dependency Status License Downloads

koa uuid middleware

Installation

$ npm install koa-uuid

Configuration

default configuration

const options = {
  signed: false,
  maxAge: 1000 * 60 * 60 * 24 * 365 * 10,
  httpOnly: true,
}

Example

const uuid = require('koa-uuid')
const Koa = require('koa')

// options is not reuqire and will be assign
const options = {
  maxAge,
  expires,
  path,
  domain,
  secure,
  httpOnly,
  sameSite,
  signed,
  overwrite,
  ...
}

const app = new Koa()
app.use(uuid(options))

Attention

configuration signed: true require app.keys, otherwise signed will always be false

const uuid = require('koa-uuid')
const Koa = require('koa')

const app = new Koa()

app.keys = ['secret', 'key'];
app.use(uuid({ signed: true }));

License

MIT

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago