1 Star 0 Fork 0

liubo/ks3-node-signer-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 814 Bytes
一键复制 编辑 原始数据 按行查看 历史
liubo 提交于 2023-09-26 21:38 +08:00 . no message
var express = require('express');
var auth = require('./auth');
var app = express();
// 替换成自己的AK和SK
var config = {
ak: process.env.AK,
sk: process.env.SK
}
app.use(express.json())
app.post('/', function (request, response) {
const body = request.body;
console.log('request body:', body);
if (!body.headers) body.headers = {}
body.headers['Content-MD5'] = body.content_md5
const date = body.date;
const req = {
method: body.http_method,
type: body.content_type,
resource: body.resource,
headers: body.headers,
date
}
var signature = auth.generateAuth(config.ak, config.sk, req, null);
response.send(signature);
});
app.listen(8000, function () {
console.log('----- ks3 sign server started. http://localhost:8000/ -----');
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
NodeJS
1
https://gitee.com/studyNeo/ks3-node-signer-server.git
git@gitee.com:studyNeo/ks3-node-signer-server.git
studyNeo
ks3-node-signer-server
ks3-node-signer-server
master

搜索帮助