1.0.3 • Published 9 years ago
express-jwt-sign v1.0.3
express-jwt-sign
jwt signature generator for express
Installation
$ npm install --save express-jwt-signUsage
const express = require('express');
const jwtsign = require('express-jwt-sign');
const appId = 'fe/star';
const appSecret = 'xxx';    // 这两个参数需要保密
const app = express();
app.use(jwtsign(appId, appSecret, {
    pathPattern: /\/star\/evaluations\//,   // ignore to generate jwt signature on all requests
    expireInSeconds: 60,                    // default to 1 hour
});
app.use(function (req, res, next) {
    console.log(req.__jwtsignature);
});License
MIT © wangshijun
1.0.3
9 years ago