Composer其余服务器实体太大 [英] Composer rest server entity too large

查看:53
本文介绍了Composer其余服务器实体太大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将图像存储在矩阵区块链中作为base64字符串.在这里,每当我尝试通过作曲家休息服务器与区块链进行交互(更新或添加包括base64字符串的资产)时,都会抛出错误,

I'm storing images in fabric blockchain as base64 strings. Here, whenever I try to interact(update or add assets including base64 strings) with the blockchain through the composer rest server, it throws below error,

Error: request entity too large

如何增加请求大小限制,或者还有什么其他可能的方法来解决此问题?

How to increase the request size limit or what are other possible approaches to handle this issue?

推荐答案

我能够通过编辑path_to_rest_server/server/中的server.js来编辑REST服务器的最大请求大小.我编辑了以下代码,

I was able to edit the maximum request size of the REST server by editing the server.js located in path_to_rest_server/server/. I edited below code,

// Support JSON encoded bodies.
app.middleware('parse', bodyParser.json());

// Support URL encoded bodies.
app.middleware('parse', bodyParser.urlencoded({
    extended: true,
}));

// Support JSON encoded bodies.
app.middleware('parse', bodyParser.json({
  strict: false,
  limit: "10000kb"
}));

// Support URL encoded bodies.
app.middleware('parse', bodyParser.urlencoded({
  extended: true,
  limit: "10000kb"
}));

10000kb是大小限制.

这篇关于Composer其余服务器实体太大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆